4.1. APIs
The process virtual machine contains 4 integrated APIs that cover complete process work in different execution modes. Each API has a specific purpose that satisfies the following schema.
4 APIs in the process virtual machine
Figure 4.1. 4 APIs in the process virtual machine
The service interface is used in the application code to interact with the process virtual machine, which runs in the persistence mode of the support transaction, and the backend is based on the database. This is the most common way for users to use PVM as a workflow engine.
If you do not want to execute the process in a persistent fashion, you can use the client API directly to process processes and execute objects. The client API exposes the methods of the core model objects externally.
The activity API is used to implement the behavior of an activity at run time. So an activity type is actually a component, and the core is the implementation of the Activitybehaviour interface. An active behavior implementation can control the flow of execution.
The event Listener API is used to write Java code that can be used to handle process events. It is similar to the active API, and the only difference is that the event listener does not control the executing process.
4.2. Activity API
The Activity API allows you to implement runtime activity behavior using Java.
Public interface Activitybehaviour extends Serializable {
void execute (activityexecution execution) throws n;
}
An activity is a behavior that is assigned to an activity. The delivery is performed to reach the execution of this activity. The Activityexecution interface exposes methods for controlling the execution process.
Public interface Activityexecution extends Openexecution {
void waitforsignal ();
void Take (String transitionname);
void execute (String activityname);
...
}