My question is I Have a login form has 2 fields username and password and 2 buttons, submit and cancel.
How do i make when user clicks submit button it shud authenticate username and password entered by user and go to success step in next primary stage if they are authenticated, Else go to my alternate stage step which say authentication fail.
What are you authenticating the user for? I mean, they're already authenticated as users in the Pega7 system, right?
That question aside, the more generic answer to your question is:
1) The post-processing activity of the flow action determines whether authentication was successful or not. If it was, it sets the corresponding flag (true/false property) to true, if not, it sets it to fail.
2) Go into the Process Modeler for that flow. Have the connector coming out of the assignment lead to a decision shape set to the FORK option. One connector exiting the fork tests the flag for 'true', and if so, it just goes to an End shape so the next stage will be reached. The other connector tests for 'false', and it goes to a Change Stage shape so that you can go into the Authentication Fail alternate stage.