Add conditions to interactive components

What about the error state?

If I try to express like below situation, I can not add two onClick events, so I have to make some wrapper frame or something in Prototype.

Login Button ->onClick -> Error Dialog
                       -> Success Dialog

In this case, the new Starting point also can not handle it. Event dependent from Starting point is a passably good option, maybe?

For Example, in the below case, I can have multiple onClick but dependent on the Starting point.

Success Starting Point ->             -> onClick -> Error Dialog
                          Login Button
Error Starting Point   ->             -> onClick -> Success Dialog