The responsible class to simulate of BPM Process execution is PEFBpmProcessExecutor.
This class can: * Receive a BpmTaskInstance in a BpmProcessInstance. * Assign the BpmTaskAssignment to a BpmUser. * Set the external object of the BpmTaskInstance with an OrbeonFromInstance or a BusinessObject. * Finalize the BpmTaskAssignment and generate next tasks. In most cases an Orbeon Form is used to simulate a task. The class responsible to generate OrbeonFormDefintion and OrbeonFormInstance is OrbeonSavedFormDefinition. To do this the XML string of the form definition and instance has to be passed as arguments to OrbeonSavedFormDefinition.
Automatic Process Execution in SUnit BpmProcessExecutionTest class has the proper structure and methods to simulate the BPM Process execution and it does it with the help of the PEF framework. In order to simulate a process exectuion a subclass of BpmProcessExecutionTest must be created. One subclass per BPM process definition. The picture below show the SUnit with all tests for the BPM Execution Engine. Each Test Class represent a BPM Process and the tests usually are differents path that the process can follow.