Choose between workflow's based on the button's status

I have a Vote button which can be Voted and Unvoted.

Whats the best method to tell the program to choose between workflows based on the Vote status, (use one workflow when the button is Unvoted (save the vote in the database), and another workflow when the button is Voted (unsave from database))

In other words, how do u tell the program that the status of the button has changed and u need to use a different workflow for the same Button Click?

Also how do i make the icon change to a different color based on the Vote status?

look at the workflow, only when will do the trick. (at the bottom of the edit the workflows WHEN tab.

as for the status what you want is to create a custom state.

So when i create a Workflow to save the Vote:

Only when… what do i write?

And where do i specify the “Otherwise” to use a different Workflow?

if its vote/unvote using the database as you describe then it would be two when tabs, one’s “only when” set to dosearchfor thisvotableitem’s isvoted is “yes” & dosearchfor thisvotableitem’s isvoted is not “no”.

then make the other one,

dosearchfor thisvotableitem’s isvoted is “no” & dosearchfor thisvotableitem’s isvoted is not “yes”.

that way only one set on WHEN workflow actions will run.

Only when, on the event or on the action?

if you do it on the main big WHEN tab it will stop that workflow run, if you do it in an action it will only stop that action. its up to you although i prefer to have 2 WHEN rules to clearly define whats happening and not interfere or stop another action…