You are here

function _workflow_rules_node_check_previous_state in Workflow 7.2

Condition implementation: check previous state.

Only for Workflow Node! Workflow Field can use default Rules condition.

1 string reference to '_workflow_rules_node_check_previous_state'
_workflownode_rules_condition_info in workflow_rules/workflow_rules.node.inc
Implements subfunction of hook_rules_condition_info().

File

workflow_rules/workflow_rules.rules-callback.inc, line 114
Callback implementations for Rules integration for the Workflow module.

Code

function _workflow_rules_node_check_previous_state($node, $sids) {
  if (!($last_transition = workflow_transition_load_single('node', $node->nid, ''))) {
    return FALSE;
  }
  $sid = $last_transition->old_sid;
  return _workflow_rules_workflow_check_given_state($sid, $sids);
}