When do you define asynchronous methods?
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 function within the method uses the update task - The method is terminated by an event generated when the update task is successful. 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.
The method can also be called outside the workflow - 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.
An asynchronous method with comprehensive functionality is called in the task - This task gets its specific character from the terminating events. e.g., 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.
It is also to be possible for the task to be terminated by events not necessarily from method processing - The task in which the method Process sales order is executed is also terminated by the event Customer unable to pay.