External Tasks

External tasks are tasks that are implemented outside the BPM system.

The External task implementation allows you to implement the interactive activity (more precisely the GUI presented to the user) outside the BPM system.

It is a framework to allow adding an external UI interface when executing an interactive task without using any of the BPM system's presentation capabilities (BPM Object Presentations, Screenflows, etc). These tasks are accessible from PAPI/PAPIWS by calling the methods. For further information see the PAPI's JavaDoc documentation.

For example, this is useful if you need to integrate the Engine with a .NET client.
prepareExternalActivity( ... )
commitExternalActivity( ... )
The framework functions as follows:
  1. A page displays all instances (you can get this using PAPI or PAPIWS).
  2. You select the instance for execution (this instance is waiting in an interactive activity).
  3. To start the execution, the prepare method should be executed. This method can retrieve some information from the instance as well as leveraging retrieval of other information using the BPM system's integration capabilities. Upon successful execution of the prepare method, the instance will remain locked for that participant to prevent other participant from starting the execution for that instance.
  4. You can render your own UI (ASP.NET, etc).
  5. When this is submitted, the commit method should be executed. This method receives information collected from the external UI and most likely synchronize this data with instance variables. You can also perform transactions against your back-end systems using the BPM system's integration capabilities. Upon successful execution of this method, the lock over the instance will be released and the task will be marked as completed.
When you select the External implementation you have to specify two methods:

Both methods can declare input/output arguments that will be passed along whenever they are invoked. As well both methods need to be invoked through PAPI or through PAPI-WebServices.

For example:

The instance arrives to the activity and waits there until someone sends the prepareExternalActivity() method to it. It executes the method and answers back a set of arguments (valid values lists or predefined/default values to be used by the GUI). After the user finishes with the GUI (which could be implemented anyway you want), the commitExternalActivity() method is invoked and the values entered by the user are passed along so that the BPM system can use them (set them into a BPM Object for example). Then the instance moves forward in the process (unless you finish the commitExternalActivity() method with an Action different than OK or RELEASE).