Brief Overview of Workflow Step-Types - SAP Help Portal
Brief Overview of Workflow Step-Types - SAP Help Portal
This page will help the readers to know more about the Step-Types that are used in Workflows and a wide Implementation of these Step-Types. Apart from
sending e-mails, workflows can handle a lot many affairs. This will clear the air that Workflows are generally used for sending e-mails.
Workflows can work like Algorithms in the background as well as Foreground to make the task appear in a Flow, Basically like the Flow of Work. Various
Functionalities can be Implemented like, Flow based on calculations, Flow based on Conditions, Flow based on Conditional Events, Uploading Documents,
Filling up Forms etc.
Container Operation
Container Operation is a Step-Type that is used for calculations with the help of Workflow Containers.
This Step-Type is used to derive various Arithmetic calculations from the Workflow Elements. To implement this Step-Type, we should give an Arithmetic
Condition, based on whose result the WF moves further.
Multiplication,
Addition,
Subtraction,
Division.
Here the Source and the Target Elements should be the Workflow Containers.
The Outcome of this Step-Type would be Numeric/Decimal always with 1 value.
This Arithmetic Operations take place between the values of the Workflow Containers.
These WF Containers can have Dynamic values as well as Hard-Coded values from the Workflow Container.
Multiple Conditions
Multiple Conditions is a case that is implemented where we have to check so many conditions at 1 time.
Multiple Conditions can be implemented in 2 ways:
Case,
Switch.
If condition is like this:
If name = 'ABC'
Do this.
* * Else if name = 'XYZ'
Do this.
* * Else if name = 'PQR'
Do this.
* * Else
Do this
In this example ()name should always be defined as the Workflow Container Element. The values that we pass to this WF Container Element using Binding
are the Actual Values that we look for Comparison.
Number of Values for Comparison = Number of Branches from the Multiple Condition Step-Type.
There are 3 conditions to check the name, so now we have 3 branches that will separately process each of the Condition being implemented.
Loop
Loop is a condition that is used when one has to check for a particular Condition being FALSE or TRUE. Here we can put any Condition involving 1 or more
than 1 Container Elements.
If the Condition gets satisfied, the Loop Continues or else if the Condition goes False, The Loop Terminates and Moves on to the Next Element in the WF's.
Process Control
Process Control is a very important Step-Type, since it performs a lot of Functions.
Now let us look at each of the Functions individually.
The process control step should be located in the branch of a parallel section. To uniquely identify the work item to be canceled, we must enter its node
number in the 'workflow step' field. Press F4 to find all possible entries for the node numbers.
The work item selected is set to the status logically deleted at the time of step execution. The workflow is not continued after this work-item. It terminates.
Cancel Work-Flow
Using this function, all work items of the workflow are set to the status logically deleted. If the step Process control is located in a workflow that is used as a
sub workflow, the branch of the calling workflow that contains the sub workflow is stopped.
Use this Function, when process control is located in the branch of a modeled deadline monitoring. We can then set the work item that has exceeded its
deadline, to the status completed and continue processing in the branch processing obsolete. In order to uniquely identify the work item to be cancelled, we
must enter its node number in the field workflow step. Press F4 to find all possible entries for the node numbers.
The work item selected is set to the status completed at the time of step execution.
Complete Workflow
Using this function, workflow work items are set to the status completed. If the step process control is located in a workflow that is used as a sub workflow,
the calling workflow is continued. For Details of Sub-Workflow or Local Workflow.
Using this function, all work items of the workflow are set to the status logically deleted. If the step Process control is in a workflow that is to be used as a
sub workflow, the calling workflow as well as all the work items in it is set to the status logically deleted.The whole workflow is stopped using this function.
Activate Correlation
A correlation enables us to identify objects that belong together. If we have defined a correlation by using the correlation editor (Environment->Development-
>Correlation Editor), we can activate it here. It can then be used in a wait step.Choose the event that the correlation is to be activated for, and the correlation
to be activated. Specify how the value of the correlation is to be determined:
BasisElement: If we have defined the binding in the definition of the correlation, we can specify a container element that references the corresponding
basis element from the correlation definition.
Binding: Choose this entry if we want to define a binding between the Workflow container and the correlation container.
In the field Correlation Instance, choose the container element for the correlation object.
The correlation object shows the value of the correlation. The container element for the correlation object must have the predefined data type
CL_SWF_MOD_CORRELATION.
Throw Exception
We can define a local event or an exception in the version-specific basic data of the Workflow. We define the exception handler in the block. We define local
events in the version-dependent basic data of the Workflow.
Local Event
Give a name to the Local Event created; here the name is 'New Local Event'.
A local event can be the following:
An exception that is triggered by a step of typeProcess Control. You define the exception handler in the block.
A local event that is triggered by an event controller or an event. You can use a local event to start a local Workflow. Furthermore, a step of typeWait for
Eventcan wait for a local event.
Wait
Wait Step-Type is used when we need to wait for either an Event to happen or a Condition to get satisfied, so that we can proceed further with the Workflow.
The wait step is complete once the specified condition has been fulfilled.
L: Wait for Local Event
This step enables us to stop the execution of this branch of our Workflow until a local event has arrived.
We should not use this step type in a fork to wait for an event that is triggered in another branch of the same fork.If the event arrives, it
completes all wait steps that are waiting for this event.
When waiting for an event using Workflow, the event is initially received by the Workflow and transferred to the next step, as soon as it is active.
When waiting using Workflow, an event can complete a maximum of one wait step. If more than one wait step is active, the event completes the oldest
wait step.
Fork
This Step-Type is generally used when we need parallel processing which may or may not be based on any condition. Specifying a Condition is not
mandatory for a FORK to work.
The number of Parallel Branches specifies that these many are the ways for parallel processing.
Event Creator
This Event Creator step type is used when we have to implement a BO Event or a local Event after the WF has started. For this event Creator Step, the
event must be defined for the BOR object type or class and a container element must exist in the workflow container, which refers to this BOR object type or
class. Enter the required container element and choose an event. Do the necessary Binding.
We can use this event to, start or continue another workflow.
After this Event Creator, you can implement a Local Workflow to Start based on this Event Triggering Condition.
After Implementing This Step-Type, the next step would continue only when this Event is created in the Application. Until and unless, this Event is satisfied,
WF won't continue from here.
One must have saved the Workflow to be able to create a template.The receiver of the Workflow must have installed the PC application locally on their PC
to be able to execute the work item. When the Workflow is executed, the template is opened in the relevant PC application and can be completed there. The
document is then saved in a container element in the Workflow container.
1.Create a WF Container – the Type of which you need the FORM to be. Select the FORM Step-Type there.
2. Click on CREATE.
3. Click on CONTINUE.
4. Click on CONTINUE.
5. Click on COMPLETE.
Local Workflow
In a local Workflow we can model a part of the Workflow that is started by a local event.
In this Local Workflow we should create our own Workflow Container Elements, called as Local Containers. These additional container elements are then
available to all steps that belong to this local Workflow and can be filled from the Workflow container by either an initial value or a binding.
We only need to define a binding if we want to use the event data in a Workflow. We must set the import indicator for local container elements that are filled
by a binding from the Workflow container to ensure that the binding can be traced.
Within this Local Workflow you can still create some more WF Steps, so that this should act as a Sub-Workflow for the original WF in which this Local
Workflow was created.
Right Click on the Down Arrow for Local Exception, and Click Create. Select the Send-Mail and enter the values.
The Local Workflow Looks like this:
Implement this Local Workflow after the Event Create Step-Type and see the Effect. This Local Workflow will trigger for the Specified Event happening
after the start of the original Workflow. In the Event Creator Step-Type, Use the Local Workflow as the Event Creator: - TRIGGER LOCAL EVENT.