Activities automate processing. Activities contain a sequence of structured steps. Each step calls a method rule or contains a control instruction such as Call or Branch. Each activity has a type that characterizes its purpose and affects which other rules can call it.
An activity is an instance of class Rule-Obj-Activity.
PRPC converts the instructions in the activity into server-side Java code. At run-time, this Java code gets executed to perform the intended tasks.
An activity rule can consist of n number of steps each of which refers to a method. So, it’s required to understand the usage of methods provided OOTB in order to write an activity.
Activity Keywords
The Call, Branch, Collect, Flow-New, Java, Queue, and Rule operations are keywords, not methods:
BRANCH — Branch to another activity
Use the Branch instruction to cause the current activity to find another specified activity and branch to it without a return. When the system executes a Branch step, control transfers to another activity found through rule resolution. Execution of the original activity pauses.
When the branched activity ends, processing of the current activity ends also; no steps after the Branch step are executed.
You can pass parameters to the target activity, or you can share the current activity parameter page with the target activity.
Do not include any steps after a Branch instruction, unless the branch occurs only part of the time (because of a transition) or the later steps can be reached through a label and Jump.
CALL — Call another activity
Use the Call instruction to cause the current activity to find another specified activity and execute it. When that activity completes, control returns to the calling activity.
The calling activity can pass parameter values to the called activity in two ways.
Only parameter values entered are passed if the Pass current parameter page checkbox is not selected in the Steps tab.
The parameter page is shared between the two activities if the Pass current parameter page checkbox is selected in the Steps tab. This approach is known as call-by-reference.
COLLECT — Begin execution of a collection rule
FLOW-NEW — Start a flow execution
JAVA — Use Java in an activity step
QUEUE — Execute another activity asynchronously
RULE — Use the Rule instruction to implement a custom rule type