Search code examples
javablueprismrpa

How to find out whether a particular BluePrism has completed or not in Java?


I need to

  1. start a BluePrism process and
  2. wait until it has completed

in a Java application which runs on a machine without a BluePrism client.

I know that it is possible to start a process using a SOAP call.

How can I find out whether or not the started process is finished and whether or not it completed successfully?

A colleague of mine said that it is possible to get a notification from BluePrism by passing a special parameter in the SOAP request, but I could not find anything on that in the Web Services User Guide.

Update 1: One solution is to adapt this software so that it exposes the BluePrism queues via a REST API.

Update 2: This page suggests running a query like below against the BluePrism database.

SELECT
    [BPAProcess].[name],
    [BPAProcess].[description],
    [BPASession].[sessionid],
    [BPASession].[startdatetime],
    [BPASession].[enddatetime],
    [BPASession].[statusid],
    [BPAStatus].[description]
FROM [BPAProcess]
JOIN [BPASession] ON
    [BPASession].[processid] = [BPAProcess].[processid]
JOIN [BPAStatus] ON
    [BPASession].[statusid] = [BPAStatus].[statusid]
WHERE [BPAStatus].[description] IN ('Completed', 'Stopped', 'Terminated')
    AND [BPASession].[sessionid] = 'Your session id'

Update 3: The BluePrism version is 6.4.2.

Update 4: Additional information is available in the BluePrism community.


Solution

  • If you expose the process in question as a web service (System -> Processes -> Exposure) and invoke it this way, the SOAP response will not be returned until the process has completed running. Your Java code can simply wait for the response to be returned from the endpoint to be sure that the process you invoked has completed.

    While I can't seem to locate any formal documentation of this behavior, this aligns with the intended design to enable the return of output values from the process/object being invoked back to the SOAP caller. (The output values couldn't possibly be known if the request resolves before the process is finished executing.)