You are here

You are here

Signaling Workflow

The BPMSignalWorkflow method is meant to be used in conjunction with the Wait for Signal workflow activity.  At a high level, the use case for using this method is to integrate processes in a 3rd party system with a SpringCM workflow.  The business processes leveraging this method usually involve processes in the 3rd party system that are either long running or that need to wait long periods of time for additional data to be obtained before the business process is allowed to continue.

The following outlines how to design a process leveraging this method call and workflow activity:

  1. A workflow is initiated in SpringCM.  The business process reaches a point where the workflow must wait either for some data or an event from a 3rd party system that then allows the workflow to continue.  For data retrieval that can be executed immediately against a RESTful API, the HttpClient workflow activity can be used and in this case, the BPMSignalWorkflow method is not needed. 
  2. If a longer running process for data retrieval is used or the workflow must "sleep" waiting on an event such as additional documents coming into the system, the workflow executes the Wait for Signal activity and then will "sleep" until it is signaled or reaches a user defined time out.  The workflow must be designed to make its Id available to the 3rd party system so that it will know how to call back into that particular workflow.
  3. When the 3rd party system is ready to "wake up" the workflow and allow it to continue its execution, the BPMSignalWorkflow method can be called via web services passing the workflow Id of the workflow to be signaled.  Additional data can be passed in the web service call that is then written to the workflow variable defined in the Output Variable section of the Wait for Signal workflow activity.  This allows the 3rd party system to not only continue to the workflow, but also easily pass data back to it.

Vertical Tabs

c#
//It is assumed here that the workflow instance Id was passed to the code
//at some point by the workflow either through the HttpClient step or 
//as document metadata.
//The "data" is a string that will be written to the Output Variable defined
//in the Wait for Signal activity
springCMService.BPMSignalWorkflow(token, instanceId, data);
java
//It is assumed here that the workflow instance Id was passed to the code
//at some point by the workflow either through the HttpClient step or 
//as document metadata.
//The "data" is a string that will be written to the Output Variable defined
//in the Wait for Signal activity
springCMService.BPMSignalWorkflow(token, instanceId, data);