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:
- A page displays all instances (you can get this using PAPI or PAPIWS).
- You select the instance for execution (this instance is waiting in an interactive
activity).
- 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.
- You can render your own UI (ASP.NET, etc).
- 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:
- The prepareExternalActivity() method can be used to get any values needed by the
presentation before actually displaying it.
This method extracts and processes information from the instance variables or BPM Objects,
and makes it accessible through its output arguments
- The commitExternalActivity() method should be invoked once the user finished with the GUI
and processing can continue in the BPM system.
This method completes the task (and the instance if necessary), and maps its input
arguments to instance variables.
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).
- Configuration: you can optionally define an URL. When the task is executed from WorkSpace,
WorkSpace redirects the execution to the URL.