Skip to Content

Friends….

  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

  http://scn.sap.com/blogs/anomitroguha/2012/04/11/part-3-creation-of-a-workflow-standard-task-and-binding-of-rule ).

‘Conditions’ tab in ‘Activity’ step type will perform the different types of conditions on workitems, like before starting of a workitem.

img 1.png

We have 3 types of conditions.

  1. 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.
  2. 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.
  3. Complete Execution: After execution of the workitem, the condition will be evaluated and if it is true then only the workitem will complete.

Step 1:

Create a workflow container element and make it as import as mentioned below.

img 2.png

Step 2:

I have created a Task with the following details.

img 3.png

Save the task.

  1. 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’.

img 4.png

Come back from the screen. Enter some text in the Task Description

img 5.png

  1. 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.

img 6.png

Go to ‘condition’ tab in the activity step. We can observe three types of conditions in the screen.

  1. Create workitem
  2. Complete workitem
  3. Complete execution

img 7.png

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

img 8.png

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.

img 9.png

Save, activate and execute the workflow. Provide element WI_Elem value as ‘5’ and execute.

img 10.png

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.

img 11.png

In the technical details of log, we can observe a different symbol at the step and in ‘Message’ tab message text as ‘Execution Interrupted’.

img 12.png

Go and check in the agent inbox. There is no workitem from our workflow.

img 13.png

In the execution time of our workflow, if I provide the element WI_Elem value as 10, it will works fine.

img 14.png

img 15.png

After workitem execution the workflow log appears as usual.

ENJOY WORKFLOWS…..

Regards,

Murali Krishna.

To report this post you need to login first.

22 Comments

You must be Logged on to comment or reply to a post.

  1. Modak Gupta

    Hey Murali

    Good one!

    I have book marked it to provide this as an answer to various dicussions where people want specific checks before or after step executions and not allow to proceed further.

    Be prepared for a lot of likes 😉

    regards,

    Modak

    (0) 
  2. Ibrahim Ansari

    Nice doc. and worth reading….

    Can you explain the real time difference between  Complete Workitem and Complete Execution options? also with some realtime exampls of thier usage.

    Regards,

    Ibrahim

    (0) 
    1. Murali Krishna Post author

      Hi ibrahim,

      I am just digging the workflow (every step types & etc ) and came to know that conditions tab. I haven’t worked on that particular requirement. I will update you surely if I got any inputs for the same,

      Thanks.

      Regards,

      Murali Krishna.

      (0) 
  3. Gaurang Gujar

    Hi Murali,

    Thanks a lot for the wonderful Blog and sharing your Knowledge.

    It would be great if you can add the real workflow scenario’s where conditions can be used.

    Regards,

    Gaurang

    (0) 

Leave a Reply