Definition as Synchronous or Asynchronous Method (BOR) 
When deciding whether you want to define a method as synchronous or asynchronous, consider the environment of the subsequent use of the method in a task:
Definition as … |
Use |
|---|---|
Asynchronous method |
A task that refers to an asynchronous object method must be defined with at least one terminating event. If you define an asynchronous method, you must ensure that one of the terminating events is triggered after execution of the method. At runtime, the relevant work item is only terminated if one of the defined terminating events occurs. |
Synchronous method |
A task that refers to a synchronous object method can be defined with terminating events. At runtime, the relevant work item is generally terminated when the synchronous method has been successfully executed. But the work item is also terminated if one of the defined terminating events occurs. |
You define a method as an asynchronous method if you want a task that uses this method to be terminated only via events. The following are possible reasons for defining a method as asynchronous:
The method is terminated by an event generated when the update task is successful.
Note
If you nevertheless define the method as a synchronous method under these circumstances, the workflow data may be inconsistent with the current data in the database due to update terminations or delays.
If it is possible that a user may call the function encapsulated in the method outside the workflow although the object is also being processed under the control of a workflow at the same time, you should implement the method as an asynchronous method. It is therefore irrelevant whether calling the function takes place inside or outside the workflow system. The workflow continues after the event occurs.
This task gets its specific character from the terminating events.
Example
In a task, a specific order is to be released for billing. In the task, call the (general) method Process order and enter the event Billing block deleted as the terminating event.
Example
The task in which the method Process sales order is executed is also terminated by the event Customer unable to pay.
You define a method as a synchronous method if you want to use the processing results as method parameters or results.
The following are also possible reasons for defining a method as synchronous:
Example
The method Display for displaying an object.
Processing of the task is not completed until the agent sets the processing status to done in their Business Workplace.
Example
The method Write letter.
There are no events available that are suitable as terminating events and you have no way of creating the missing events.