IBM BPM, V8.0.1, All platforms > Programming IBM BPM > Developing client applications for BPEL processes and tasks > Developing JMS client applications (deprecated)
Example: executing a long running process using the Business Process Choreographer JMS API (deprecated)
This example shows how to create a generic client application that uses the JMS API to work with long-running processes.
Attention: The Business Process Choreographer JMS API is deprecated. To develop JMS-based client applications, use the Business Process Choreographer web services API with the SOAP/JMS transport protocol.
Procedure
- Set up the JMS environment, as described in Access the Business Process Choreographer JMS API (deprecated).
- Obtain a list of installed process definitions.
- Send queryProcessTemplates.
- This returns a list of ProcessTemplate objects.
- Obtain a list of start activities (receive or pick with createInstance="yes").
- Send getStartActivities.
- This returns a list of InboundOperationTemplate objects.
- Create an input message. This is environment-specific, and might require the use of predeployed, process-specific artifacts.
- Create a process instance.
- Issue a sendMessage.
With the JMS API, you can also use the call operation for interacting with long-running, request-response operations provided by a BPEL process. This operation returns the operation result or fault to the specified reply-to destination, even after a long period of time. Therefore, if you use the call operation, you do not need to use the query and getOutputMessage operations to obtain the process’ output or fault message.
- Optional: Obtain output messages from the process instances by repeating the following steps:
- Issue query to obtain the finished state of the process instance.
- Issue getOutputMessage .
- Optional: Work with additional operations exposed by the process:
- Issue getWaitingActivities or getActiveEventHandlers to obtain a list of InboundOperationTemplate objects.
- Create input messages.
- Send messages with sendMessage.
- Optional: Get and set custom properties that are defined on the process or contained activities with getCustomProperties and setCustomProperties.
- Finish working with a process instance:
- Send delete and terminate to finish working with the long-running process.