The starting point of a workflow
is the object/event trigger. Without this the possibility of building a
workflow is ruled out. The triggering of events is achieved through a number of
mechanisms some of them are listed below:
Events
can be created in the following ways:
Change
document
Status
management
Message
control
Custom code: The function module SWE_EVENT_CREATE
is used to trigger the event. Don’t forget to write a commit
work after the function module call.
11. A Single Step Task.
By
now you have defined a Business Object with key fields Company code, Accounting
document number and Fiscal year. You have created a method and an event for the
Business Object. You have also defined the Task for linking the method and
event and also defined containers and performed the binding definition. You
have also defined the custom code to trigger the event. Now, your objective is
to display financial document using CALL TRANSACTION ‘FB03’, when the event is
triggered. For this you must put the following piece of code inside the method
of the object and generate it.
Check
that you have given your username in the agent assignment section of the task.
Now when you execute the custom code the event will be triggered, so the key
fields will be inside the event container, from there it will pass on to the
task containers you have defined. This transfer is controlled by the binding
definition you established before activating the task. From the task container
the key fields will be available inside the Business Object. Thus they will be
assessable inside the Object Method, where you use them to display the
financial document.
What is Workflow: Workflow is a tool to automate
business process
Workflow
can be single step or multiple steps.
Single
step workflows are “Tasks” and multiple step workflows are “Templates”.
Workflow determines which tasks are executed, when, under
which conditions and by whom.
Workflow
definition is made up of individual steps. When creating a step in a workflow
definition, the step type must be specified first. Specify the step type as Activity here.
Activity can be a single step task with
basic business functionality
Can be a multi-step task, which reference
to a workflow definition
What
are the different elements of Workflow:
Tasks: Activity in which an object method is carried out.
Business Objects: Identifiable specific instances of an
object type.
Work Item: A
work item is an actual representation of a task.
Agent: An agent is an executor of a work item. Types of
agents:
Possible agent
Deadline agent
Notification
agent
Methods:
Events
Containers:
Containers are
used to store field values, multi-line lists of field values, object references
and multi-line lists of object references.
All
import/export parameters of the workflow tasks/workflow templates are specified
as elements of the workflow container.
Containers only
contain control information for the workflow system.
Containers
do not contain application business data.
Binding:
Binding definition executed
at runtime
Used for transferring data
from one container to another container
Used for assigning values to
container elements
Binding is always performed
with reference to the elements of a container.
Data flows between the workflow
components as follows:
1) Triggering event is created in application.
2) The workflow receives the application data
from the event.
3) The workflow step transfers application data
from the workflow to the synchronous customer/standard task.
4) The task transfers application data from the
task to the object method parameters.
5) The execution of the object method may change
the application data. The object method
parameters transfer data to the task.
6) The task transfers application data back to
the workflow.
7) The workflow step transfers application data
from the workflow to the synchronous customer/standard task.
8) The workflow step transfers application data
to the standard role parameters.
9) The task transfers application data from the
task to the object
method parameters.
method parameters.
10) The execution of the object method
may change the application data. The
object method parameters transfer data to the task.
11) The task transfers application data
back to the workflow.
12) The workflow step transfers
application data from the workflow to the asynchronous customer/standard task.
13) The task transfers application data
from the task to the object
method parameters.
method parameters.
14) The terminating event transfers
application data to the task.
15) The task transfers application data
back to the workflow.
The dataflow between the
application and workflow container elements and between the elements of the
workflow container, event containers, task containers, role containers, and
method parameter containers is controlled by a set of rules called the binding
definition.
No comments:
Post a Comment