Condition to start a workitem
We can put conditions to create the workitem, after creation of the workitem and after execution of the workitem.
(We can use Condition step type to validate the technical functions). (If you are not familiar with Standard task creation, check the below link
‘Conditions’ tab in ‘Activity’ step type will perform the different types of conditions on workitems, like before starting of a workitem.
We have 3 types of conditions.
- Create workitem: When a workitem was generated, it will check the respective condition was satisfied or not? At that time the workitem status is “IN PREPARATION”, the workitem is not accessible anywhere.
- Complete Workitem: In this case, workitem will be generated, but it will not complete until the condition is true. The workitem will not complete until the condition evaluates to true.
- Complete Execution: After execution of the workitem, the condition will be evaluated and if it is true then only the workitem will complete.
Create a workflow container element and make it as import as mentioned below.
I have created a Task with the following details.
Save the task.
- Maintain the task as ‘General Task’ as mentioned below. Menu options –> Additional data–> Agent assignment–> Maintain.
Select the task and click on ‘Attributes’ button. Select ‘General Task’ radio button and click on ‘Transfer’.
Come back from the screen. Enter some text in the Task Description
- Save task & come back. Maintain possible Binding from Workflow to Task and vice versa.
In the ‘Agents’ tab of activity step, select ‘User’ and any user name as mentioned below.
Go to ‘condition’ tab in the activity step. We can observe three types of conditions in the screen.
- Create workitem
- Complete workitem
- Complete execution
Open ‘create work item’ tab to create a condition, if this condition is true then only workitem will create.
Click on ‘click here to create a new condition’ sentence to create the condition.
Enter the following condition
Note: We know the condition is false, for this step workitem will not create until the condition is true.
We can find a symbol in the ‘conditions’ tab as mentioned below.
Save, activate and execute the workflow. Provide element WI_Elem value as ‘5’ and execute.
It will show the agent name in the ActiveX version log but unfortunately the workitem will not be available in agent inbox. Scroll down to check user inbox.
In the technical details of log, we can observe a different symbol at the step and in ‘Message’ tab message text as ‘Execution Interrupted’.
Go and check in the agent inbox. There is no workitem from our workflow.
In the execution time of our workflow, if I provide the element WI_Elem value as 10, it will works fine.
After workitem execution the workflow log appears as usual.