- 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:
- Workflow -> Create -> Give name wf_decision_task_example -> Click ok.
- Drag s_m_filter_example and S_M_TOTAL_SAL_EXAMPLE to workspace and link both of them to START task.
- 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.
- Right click DECISION_Example-> EDIT -> GENERAL tab.
- Set ‘Treat Input Links As’ to OR. Default is AND. Apply and click OK.
- 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
- Validate the condition -> Click Apply -> OK.
- Drag command task and S_m_sample_mapping_EMP task to workspace and link them to DECISION_Example task.
- Double click link between S_m_sample_mapping_EMP & DECISION_Example & give the condition: $DECISION_Example.Condition = 0. Validate & click OK.
- Double click link between Command task and DECISION_Example and give the condition: $DECISION_Example.Condition = 1. Validate and click OK.
- Workflow Validate and repository Save.
- Run workflow and see the result.
No comments:
Post a Comment
Thank you :
- kareem