Thursday, January 10, 2013

DECISION TASK



  • The Decision task allows us to enter a condition that determines the execution of the workflow, similar to a link condition.
  • The Decision task has a pre-defined variable called $Decision_task_name.condition that represents the result of the decision condition.
  • The Power Center Server evaluates the condition in the Decision task and sets the pre-defined condition variable to True (1) or False (0).
  • We can specify one decision condition per Decision task.
Example: Command Task should run only if either s_m_filter_example or
S_M_TOTAL_SAL_EXAMPLE succeeds. If any of s_m_filter_example or
S_M_TOTAL_SAL_EXAMPLE fails then S_m_sample_mapping_EMP should run.
Steps for creating workflow:
  1. Workflow -> Create -> Give name wf_decision_task_example -> Click ok.
  2. Drag s_m_filter_example and S_M_TOTAL_SAL_EXAMPLE to workspace and link both of them to START task.
  3. Click Tasks -> Create -> Select DECISION from list. Give name DECISION_Example. Click Create and then done. Link DECISION_Example to both s_m_filter_example and S_M_TOTAL_SAL_EXAMPLE.
  4. Right click DECISION_Example-> EDIT -> GENERAL tab.
  5. Set ‘Treat Input Links As’ to OR. Default is AND. Apply and click OK.
  6. Now edit decision task again and go to PROPERTIES Tab. Open the Expression editor by clicking the VALUE section of Decision Name attribute and enter the following condition: $S_M_FILTER_EXAMPLE.Status = SUCCEEDED OR $S_M_TOTAL_SAL_EXAMPLE.Status = SUCCEEDED
  7. Validate the condition -> Click Apply -> OK.
  8. Drag command task and S_m_sample_mapping_EMP task to workspace and link them to DECISION_Example task.
  9. Double click link between S_m_sample_mapping_EMP & DECISION_Example & give the condition: $DECISION_Example.Condition = 0. Validate & click OK.
  10. Double click link between Command task and DECISION_Example and give the condition: $DECISION_Example.Condition = 1. Validate and click OK.
  11. Workflow Validate and repository Save.
  12. Run workflow and see the result.

clip_image002[5]


No comments:

Post a Comment

Thank you :
- kareem