- Business rule
- Save Data
- Kafka send
- Send data to user interface
- Upload file
- Start subprocess
- Append params to parent process
You can only define and add actions on the following types of nodes: send message task, task and user task.
Action rules
Business rules can be attached to a node by using actions with action rules on them. These can be specified using DMN rules, MVEL expressions, or scripts written in JavaScript, Python, or Groovy.Supported scripts
More information about supported scripting languages, here.
- Manual or automatic
- They can be set as optional or mandatory, if not all mandatory actions are performed on the process node, the flow will not advance
- Actions can also be marked as one-time or repeatable
parentName
field on the action to be used as a callback. The callback actions can be performed when a certain message is received by the Engine. In order for this to happen the callbacksForAction
header needs to be set on the message. Callback actions can also be configured to run immediately after the parent action is run, by setting the autoRunChildren
flag to true for the parent action.
Business rule action
Action parameters
Action params are used to set extra values for actions. They are stored as key/value pairs. For example, we can set a topic to use for sending outgoing messages or the message format to be sent to the front-end. The decision that needs to be defined on an exclusive gateway is defined using a node rule. Similar to action rules, these can be set using DMN or MVEL. There are two possible kinds of actions:- business logic rules
- interactions with users
Configuring actions
Actions have a few characteristics that need to be set:- an action can be set as manual or automatic. Manual actions can be executed only through the REST API, this usually means they are triggered by the application user from the interface. Automatic actions are executed without any need for external triggers.
- manual actions can be either mandatory or optional. Automatic actions are all considered mandatory.
- all actions have an order. When there are more actions on a single node, the order needs to be set.
- repeatable - the actions that could be triggered more than once are marked accordingly
- the actions can have a parent/child hierarchy
Adding an action to a node
Linking actions together
There are two ways actions could be linked together, so certain actions can be set to run immediately after others.Child actions
A parent action has a flagautoRunChildren
, set to false
by default. When this flag is set to true
, the child actions (the ones defined as mandatory and automatic) will be run immediately after the execution of the parent action is finalized.
Callback actions
Child actions can be marked as callbacks to be run after a reply from an external system is received. They will need to be set when defining the interaction with the external system (the Kafka send action). For example, a callback function might be used to handle a userβs interaction with a web page, such as upload a file. When the user performs the action, the callback function is executed, allowing the web application to respond appropriately.
Example
Callback actions are added in the Advanced configuration tab, in the header param -callbacksForAction
.
callbacksForAction
- the value of this key is a string that specifies a callback action associated with the βupload_fileβ destination ID. This is part of an event-driven system (Kafka send action) where this callback will be called once the βupload_fileβ action is completed.