In order to understand the data flow we need to understand few terms which I will be using to define dataflow.
SAP Application: It is an application component or we can say its a module like MM, SD, FI, HR etc.
Action happened: Action happened represents the completion of action. For example: creation of purchase order is an action but Purchase order created is Action Happened that is completion of action. Similarly change of Sales order is an action but Sales order changed signifies that action has happened.
Events: It signifies that action has happened and also signifies the change in status of document. For example: Purchase Order Created, so Created is an event. Purchase Requisition approved signifies the change in status of Purchase order, Approved is Event here.
Triggering Event: Event which triggers workflow is called Triggering event.
What it is?
What happens at backend?
What does Triggering means?
Search whether workflow template is assigned to Event and Business Object and should be in active state. In technical terms it is basically a SELECT statement on table(s) to find out the valid entry. ( It is called Triggering of Event)
Containers: Containers is same as literal meaning that is it contains variables and its values. There are different containers.
Event Container: It is attached to Event and holds all parameters in Event Environment.
Workflow Container: Attached to workflow and its scope is global in workflow. But can not be accessed by method directly.
Task Container: Tasks are attached to activities in workflow and there is a container attached to it whose scope is task environment.
Method Container: Contains method parameters of Methods.
Binding: Linking two different containers are called binding.
Agents: Person responsible to perform task. It will always be SAP user id. There are different ways of determining SAP user id. It may attach to position in Organization structure or may be attach to Job etc. Also it can be determined using roles determination through function modules.
Data Flow Diagram
How does data flow?
When transaction is performed and action has happened an event is triggered. Event should be in Business Object. The moment event is triggered event parameters are populated in event container.
Once event is triggered it is checked whether it is configured for any workflow template and is active? If it finds one and binding is there between event and workflow container it passes data from event container to workflow container which is further used by workflow to process steps configured in it.
Event Container has binding with workflow container only and it is unidirectional. That is data flows from event container to workflow container only.
Now as workflow moves from one activity to another in workflow builder. Binding is to be established between workflow container and task container. It is bi directional. Once data moves to task container it is accessible to methods of business object through Macros.
Sometimes there are method containers available for methods. In those cases method of business object can access data only if there is binding between task container and method container. It is also bi directional.
Once data is accessible to method processing is done on that and results are returned to containers which enables workflow to proceed ahead.