sendMessages Step
Description:
This step allows you to send messages between or within the same workflow instance. It is used for inter-process communication (IPC). Other workflows can be configured with the step “waitForMessages” to wait for incoming messages.
NOTE: If you want to send the message to all waiting workflows, we recommend writing a custom event handler and sending the message to that. Using the FlowWright API, the event handler should get all waiting workflow instances and send a message on each one.
Inputs
-
selInstLevel– Select instance types; when sending messages, select where to send messages to, the options are the following:
- Current – current workflow
- All – all workflow instances within the hierarchy, includes all parents, children & siblings
- Siblings – send messages to only siblings
- Parents – send messages to all parents within the hierarchy
- Children – send message to all children
- Top Most – send messages to the top most workflow instance
- waitMessage – list of messages to send, should be a “,” separated list
Returns
- True/False
Usage:
Example:
Let’s build and execute the “sendMessagesDef” example.
- Create a new definition called “sendMessagesDef”
- Select the definition and click the “design” button
- Drag a “Task, WaitForMessage, and sendMessages” steps from the toolbox
- Connect the dots between the Start and the other steps as above
- Click the “Task” step to configure its “Settings” properties. Provide a name to the step.
- Click the “Task” step to configure its “Advanced” properties. Select the user to route to. Provide the task duration to complete. Click the Save button.
- Click the “sendMessages” step to configure its “Settings” properties. Provide a name to the step. Provide the message to send. Select any one of the instance types from the drop-down list - All, Children, Current, Parents, Siblings, and TopMost." Here, the instance type “Current” is selected as the message is sent to a “WaitForMessage” step in the same instance. Click the Save button.
- Click the “WaitForMessages” step to configure its “Settings” properties. Provide a name to the step. Provide the message to wait. Click the Save button.
- Save the process definition, create a process instance, and execute. The instance is sleeping on the Task step as below.
- The SendMessage step should publish/send messages to the process.
Definition Sample:
You may download the sample definition(s) from the link here and later import it (drag-drop) to your FlowWright Process Definition (XML file) or Form Definition (HTML file) page.
NOTE: Please verify and complete the process steps for any missing configurations, such as file path references and database connections after import. Then, save the definition to confirm the changes.
Click here to download the sample file.