Edit Page

Overview: orchestrate processes

This guide provides a quick overview of the major features of the Rhize BPMN engine and interface, with links to detailed guides for specific topics. For a reference of all BPMN elements and their parameters, refer to BPMN elements.

The Rhize BPMN UI provides a graphical interface to transform and standardize data flows across systems. Such process orchestration has many uses for manufacturing. For example, you can write a BPMN workflow to do any of the following:

  • Automatically ingest data from ERP and SCADA systems, then transform and store the payloads in the standardized ISA-95 representation
  • Coordinate tasks across various systems, creating a layer for different data and protocols to pass through
  • Calculate derived values from the data that is exchanged to perform functions such as waste calculation and process control.
An example of a workflow that transforms, calculates, stores, and sends to external systems
Note Rhize BPMN workflows conform to the visual grammar described in the OMG standard for Business Process Model and Notation. Each process is made of events (circles), activities (rectangles), gateways (diamonds), and flows (arrows). Some elements are extended for Rhize-specific features, such as service tasks that call the GraphQL API. Some elements from the standard are unused and thus do not appear in the UI.

Request and send data

Workflows often exchange data between Rhize and one or more external systems. The BPMN activity task templates provide multiple ways to communicate with internal and external systems, and pass data over different protocols. Additionally, message events provide templates to publish and subscribe to the Rhize broker.

Each template has a set of parameters to configure it. To use a template:

  1. Select the activity (rectangle) element.
  2. Select Template and then choose the template you want.
  3. Configure the template according to its Task parameters.

Interact with the Rhize API

Use GraphQL tasks to query and change data in your manufacturing knowledge graph. For example:

  • A scheduling workflow could use the Query task to find all JobResponses whose state is COMPLETED.
  • An ingestion workflow might use a Mutation task to update new jobResponse data that was published from a SCADA system.

You can also use JSONata in your GraphQL payloads to dynamically add values at runtime. For details about how to use the Rhize API, read the Guide to GraphQL.

Interact with external systems

To make HTTP requests to external systems, use the REST task. For example, you might send a POST with performance values to an ERP system, or use a GET operation to query test results.

Note Besides REST, you can use this template to interact with any HTTP API.

Publish and subscribe

Besides HTTP, workflows can also publish and subscribe messages over MQTT, NATS, and OPC UA.

A workflow that listens to a message and throws a message
A workflow that evaluates a message and throws a if the payload meets a certain condition message

To publish and subscribe to the Rhize broker:

  1. Select a start (thin circle) or intermediate (double-line) circle.
  2. Select the wrench icon.
  3. Select the message event (circle with an envelope).
  4. Configure the message topic and body according to the Event parameters.
  5. If using an Intermediate throw event, name the variable BODY.

To listen and publish to an edge device:

  1. Create a data source.
  2. In your workflow, select the task. And choose the Data source template.
  3. Configure the Data Source task parameters.

The strategy you choose to send and receive message data depends on your architectural setup. Generally, data-source messages come from level-1 and level-2 devices on the edge, and messages published to the Rhize broker come from any NATS, MQTT, or OPC UA client. The following diagram shows some common ways to interact with messages through BPMN.

Diagram providing decision of control flows

Transform and calculate

As the data in a workflow passes from start node to end node, it often undergoes some secondary processing. Mew properties might be added, some data might be filtered, or a node might create a set of derived values from the original input. For example, you might use calculate statistics, or transform a message payload into a format to be received by the Rhize API or an external system.

Annotated and truncated version of an example transformation to the operationEvent definition
Annotated and truncated version of mapping an external event to the operationEvent definition

To calculate and transform data, BPMN nodes can interpret the JSONata expression language. For details, read the complete Rhize guide to JSONata.

Control flows

As data passes through a workflow, you might need to conditionally direct it to specific tasks, transformations, and events. For this, Rhize has gateways, represented as diamonds.

Exclusive gateway.

Represented by an X symbol, exclusive gateways create decision branches based on whether a condition is true. While you can use JSONata conditionals to control flows within tasks, exclusive gateways are the most common and visually understandable way to execute conditional steps.

To use an exclusive gateway:

  1. Create an arrow from the control start to an exclusive gateway (diamond with X symbol).
  2. Use arrows to create outgoing conditions to new tasks or events.
  3. Leave the default condition blank.
  4. In all other arrows, use the Condition field to write a boolean expression.
Screenshot showing how gateways create a Job order only if the material state is ready.
This gateway creates a job order only if its material state is ready.

Parallel gateways

Represented by a + (plus sign) symbol, parallel gateways execute multiple tasks at the same time. To use a parallel gateway:

  1. Select a gateway.
  2. Use the wrench sign to change its condition to parallel.
  3. Use arrows to create parallel conditions.

When the workflow runs, each parallel branch executes at the same time.

Simultaneously add a record to the database and send an alert
Simultaneously add a record to the database and send an alert

Trigger workflows

You have multiple ways to trigger a start condition.

  • API triggers come from a GraphQL call to the Rhize DB.
  • Message triggers subscribe to a topic on the Rhize broker and run whenever an event is published to that topic.
  • Rule triggers subscribe to the topics on a remote data source, such as an edge OPC-UA server or MQTT broker.
  • Timer triggers start according to some schedule (once or repeating).

To learn more, read Trigger workflows.

Reuse workflows

BPMN workflows are composable, where each element can be reused by others. For example, you might create a workflow that calculates common statistics, or one that makes a specified call to an external system. Using call activities other workflows can reuse the workflow.

A call activity
An example of a main workflow calling a function. Template

To reuse a workflow:

  1. Drag the task element (rectangle) into the workflow.
  2. Select the wrench icon.
  3. Select Call Activity.
  4. Configure it according to the call activity parameters.

Access process variable context

As data passes through the nodes of a workflow, the nodes share access to a variable space. Nodes can access these variables, create new variables, and mutate existing ones. This overall variable object is called process variable context.

When working with variables, keep the following in mind:

  • Access the root variable context through $..

    This follows the conventions of JSONata. For details and examples, read Use JSONata.

  • Access nested properties with dot notation.

    For example, the following is a reference to the first item in the orders object in the variable context:

    $.orders[]
    
  • You can store a node’s output in a variable.

    Many output fields offer a way to create a variable. For example, the JSON schema field has two variables that you can name, one that outputs a boolean based on whether the input is valid, and another that outputs the error string if the variable is invalid.

    You can access these variables in later nodes (unless you mutate them).

  • Variables.

    If you direct output to a variable that already exists, the new value overwrites the old one. This behavior can be used to manage the overall memory footprint of a workflow.

  • The maximum context size is configurable.

    By default, the process variable context has a maximum size of 1MB. When an activity outputs data, the output is added to the process variable context. When variable size gets large, you have multiple strategies to reduce its size (besides mutating variables). For ideas, refer to Tune BPMN performance.

  • You can trace variable context.

    For details, refer to the Debug guide.

Examples

Rhize has a repository of templates that you can import and use in your system. Use these to explore how the key functionality works. Rhize BPMN templates