Journey Manager (JM) The transaction engine for the platform. | System Manager / DevOps | 24.10This feature was updated in 24.10
Manager uses job services to process collaboration jobs. You can define and configure a job service as a single JSONJSON (JavaScript Object Notation) is an open standard file format and data interchange format that uses human-readable text to store and transmit data objects consisting of attribute–value pairs and arrays. document, which is called a job definition. The job definition includes the list of steps that make up the collaboration job. Each of the individual steps has the list of actions to be performed when the step runs, and the routes property, which defines the next step transition by mapping the route name to the next step.
The job definition consists of the following properties:
The jobDetails
property defines a collaboration job and how it is processed. The snippet of the jobDetails
is shown below:
{
"jobDetails": {
"name": "1 Step Review",
"processSubmitImmediate": "true",
"allowEarlyCreation": true,
"version": "0.1.0"
},
"steps":[
{ .. step definition ...},
{ .. step definition ...},
...
]
}
The jobDetails
has the following attributes:
name
processSubmitImmediate
allowEarlyCreation
allowEarlyCreation
flag set to true in its job definition. The processJobAfterCreate
attribute will be ignored in this case.version
Let's look at a simple example of using the above configuration to create a job given the job controller service and version for a non submitted Txn as the initial Txn:
import com.avoka.tm.svc.*
import com.avoka.tm.vo.*
Job job3 = new JobBuilder()
.setSvcName('1 Step Review')
.setSvcVersion('0.1.0')
.setReferenceNumber('ABC123')
.setInitialTxnTrackingCode('ABC123')
.build()
The jobGroups
property lists collaboration job groups, so job coordinators can manage the collaboration job. The snippet of the jobGroups
is shown below:
"jobGroups": {}
The jobGroups
has the following attributes:
name
description
The job groups can be created in one of the following ways:
The steps
property is an JSON array that defines steps. The snippet of the steps
property is shown below:
{
"name": "Initial Review",
"type": "",
"expiryRule": "+5d"
"expiryServiceName": "An Expiry Service"
"actions": [
{ ... Action 1 Definition ... },
{ ... Action 2 Definition ... }
],
"routes": [
{ "name": "Approve", "nextStep": "Application Delivery" },
{ "name": "Decline", "nextStep": "Applicant Update" },
{ "name": "Exceeds Threshold", "nextStep": "Additional Review", "display": "false" },
{ "name": "Terminate", "nextStep": "Terminated Initial" }
]
},
The steps
has the following attributes:
name
type
start
: the first step for the collaboration job. "type":"start"
endpoint
: the processing stops and the job completes. Endpoints do not specify actions, routes or customProperties
.
"type":"endpoint"
""
: empty string. "type":""
expiryRule
job_step.time_completion_scheduled
is set as the step creation time plus the expiry rule value, for example, 2014-03-05 + 5d = 2014-03-10
. The valid values are:
"expiryRule" : "+4h"
(hours)"expiryRule" : "+5d"
(days)"expiryRule" : "+4w
(weeks)"expiryRule" : "+4m"
. (months)This is an optional attribute.
We recommend setting it up to some default value so an action doesn't stay in the queue forever, if an associated form never abandons and the task is never submitted, even as a transaction expires.
expiryServiceName
If the expiryRule
is used, but the exprityServiceName
is not specified, then expiryRoute
must be provided.
The actions
property defines the list of actions for each step, which are executed sequentially. Actions are required for all steps except endpoints. The snippet of the actions
property is shown below:
{
"name": "Create Task",
"type": "Job Task Assign",
"properties": [
{ "name": "Process Message Send Email", "value": "true" },
{ "name": "Process Message Submission Step", "value": "Start" },
{ "name": "Process Message Text", "value": "Your ${submission.formName} application is at the Initial Review Step" },
}
The actions
has the following attributes:
name
type
properties
properties
object definition below. This is an optional attribute.The standard Action Property classes (com.avoka.fc.core.service.job.impl
) define a fixed set of Action Properties. The JobTaskAssignService
defines a broad range of separate properties, so you can add them to your script when creating a new job action. This makes a job action re-useable across a collaboration job and the whole form application. For example, if the job definition has this property:
"properties": [
{ "name": "ABC Widget Name", "value": "Aplle Blue Catapillar" },
...
]
Then, you can retrieve it using the Groovy code below:
def abcName = actionStepProperties.getProperty("ABC Widget Name")
However, you should consider the following:
$formDataMap.name
doesn't resolve as the job action and it doesn't have any concept of a submission.$func.previousSubmission().formDataMap.name
resolves a submission as it obtained the submission from the previous step.$job.submission(0).name
resolves a submission as it obtained the first submission linked to the collaboration job.For more information, see job functions.
The properties
property defines the job definition properties. The snippet of the properties
property is shown below:
"properties": [
{ "name": "Task Assign Group", "value": "$func.formProperty('Initial Review')" },
{ "name": "Task Type", "value": "Review" },
]
Properties can be used to pass information into an instance of the Action Service. In this case, they are called action properties and can be defined at the action, step or collaboration job level. Properties with the same name defined at an action level override properties defined at the step level. Step override properties of the same name at the job level. This is illustrated in the snippet below:
{
"jobDetails": { ... },
"properties": [
{ "name": "Task Form Code", "value": "$func.startFormCode()" }
],
"steps":[
{
"name": "Initial Review",
"type": "",
"actions": [
{
"name": "Create Task",
"type": "Job Task Assign",
"properties": [
{ "name": "Process Message Text", "value": "Your ${submission.formName} application is at the Initial Review Step" },
{ "name": "Task Assign Group", "value": "$func.formProperty('Initial Review')" },
{ "name": "Task Message", "value": "Please perform the initial review of the ${submission.formName} from ${formDataMap.firstName} ${formDataMap.lastName}." },
{ "name": "Task Review Previous Step", "value": "true" },
{ "name": "Task Subject", "value": "Initial review of ${submission.formName} from ${formDataMap.firstName} ${formDataMap.lastName}" },
{ "name": "Task Type", "value": "Review" },
]
},
{ ... }
],
"properties": [
{ "name": "Task Form Code", "value": "$func.startFormCode()" }
],
"routes": [
{ "name": "Approve", "nextStep": "Application Delivery" },
{ "name": "Decline", "nextStep": "Applicant Update" }
],
},
{ ... }
]
}
The properties
has the following attributes:
name
value
{ "name": "Task Email Message", "value": "An Email Message" }
{ "name": "Process Message Text", "value": "Your ${job.submission.formName} application is at the Initial Review Step" }
template
$func.startUser()
will return a user.
{ "name": "Task Email Message", "value": "$func.getSubmission().formXml()", "template": "true" }
The routes
property defines the route mapping between the route name and the next step, which are required for all steps except endpoints. An action can return a route result name, as a string, which is listed in each step. If a valid name is returned, the step routes the collaboration job to the next step. However, if the action returns an invalid route name, an error is thrown. The snippet of the routes
property is shown below:
"routes": [
{ "name": "Approve", "nextStep": "Application Delivery" },
{ "name": "Decline", "nextStep": "Applicant Update" },
{ "name": "Exceeds Threshold", "nextStep": "Additional Review", "display": "false" },
{ "name": "Terminate", "nextStep": "Terminated Initial" }
]
The routes
has the following attributes:
name
nextStep
##PREVIOUS_STEP
the job processing assign the next step as the previous step name.display
"display": "false"
removes the route from the available routes. This is an optional attribute.You can see the complete example of a job definition here.
Next, learn how to configure job definition.