It is handy to be able to check the previous state of the node in Rules as well as the current state.

I will attach a patch to add a new Rules condition for checking the previous Workflow state.

Comments

kristen pol’s picture

Patch is attached

(Updating attribution on November 23, 2015.)

kristen pol’s picture

Status: Active » Needs review
nancydru’s picture

Thanks, Kristen. Is it not sufficient to check the transition from "state A" to "state B"?

kristen pol’s picture

In our case, there are times when we only want to know the previous state and actually don't care what state it is currently. :)

[Update] I'm realizing that maybe my issue summary wasn't clear as it does sounds like I wanted to check the previous and current states at the same time.

Another useful scenario: you want to negate the previous state check... e.g. previous state was not xyz.

nancydru’s picture

Status: Needs review » Fixed

Committed with attribution.

kristen pol’s picture

Thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

delacosta456’s picture

Component: Workflow Rules » Code
Issue summary: View changes

hi
sorry for re-opening this long time discussion

But i am looking in rules for having an action like "Go back to the previous State" without needs to know which state it was / without specify that state in the list of state.

The goal is that we want to have (n addition to state) radio button of Accepted / rejected.

-If accepted, action : Go to next state (already exist with workflow_rules)
- if reject , action : Go back to previous state (what i am looking for)

nancydru’s picture

Look at the code in the Workflow Revert sub-module.