Job Task Assign Service

   Journey Manager (JM) The transaction engine for the platform.  |    System Manager / DevOps  |  All versions This feature is related to all versions.

Manager allows you to create a job task assign service, which waits until all the step's previous Invoked actions have been completed.

Provides a Job Task Assign service related to collaboration jobs. The Job Task Assign Service is used for creating and assigning tasks in Journey Manager. It has the configuration properties associated with:

  • Status Updates and Email: This service can add a submission processing status messages to the specified Submission. These appear in the user's submission history. It can also send a status update via email
  • Task Assignment: These properties are used in the creation and assignment of user and group tasks.

Tasks can be categorized as:

  • Standard Tasks - to an authenticated user or a group.
  • Review Tasks - these are the similar to the standard tasks but form xml and attachments are copied from a previous submission.
  • Anonymous Save - A submission record is saved but not assigned to a user in the database. They are usually assigned to a email address, the user is sent a notification email. They click on a link. The user has to enter a challenge response before they have access to the task form.

For more information, see action statuses.

The job action wait service is an action service and it is a part of the collaboration job framework that you use to implement various form processing flows.

You can create and update a job action wait service using the Manager UI, as well as Fluent or Core API.

To create a job action wait service:

  1. Select Services > Job Services and click New .
  2. Select Job Action Wait from the Service Type dropdown list. For more information, see service types.
  3. Select a template from the Service Template dropdown list, which can be one of the following:
    • Fluent Job Action Wait
    • Groovy Job Action Wait
    • Job Action Wait
  4. Click Save to update the changes.

To configure a job action wait service:

  1. Locate a job action service.
  2. Configure the service definition. You can choose a new service type from the Service Type dropdown list to change the signature of the job service, for example, to Job Expiry Service or Job Task Wait. This won't remove the existing Groovy script or parameters.
  3. Configure the job definition. You can configure an action to call a Groovy service from a job controller, as shown below.
    "actions": [
      {
          "name": "Individual Tasks",
          "type": "Job Task Assign",
          "properties": [
             { "name": "Task Assign Repeating",  "value": "true" },
             { "name": "Task Assign Repeat Item",  "value": "$func.invoke('Repeating Get Item', ${formDataMap.itemDelimited}, ${assignRepeatIndex})" },
             { "name": "Task Type",  "value": "Review" }
          ]
       }
  4. The $func.invoke method executes the Repeating Get Item service (invoking it by the name) with two parameters.

    If you want to invoke same job action multiple times as part of single step, give them different job action names, for example, "name": "Individual Tasks 2", but define the same service name, for example,"serviceName": "Repeating Claimable". If you do not define the service name explicitly, it expects the job action name to match the service name. It's not allowed to have 2 or more job actions with the same name in one job step.

  5. Click the Job Services tab to view the Repeating Get Item service used in the action definition.
  6. Click on the service name to open this service's Groovy script.
    import com.avoka.tm.util.*
    import com.avoka.tm.vo.*
    import groovy.transform.TypeChecked
    import javax.servlet.http.*
    import org.apache.commons.lang3.StringUtils
    
    @TypeChecked
    class FluentGroovyService {
    
        // Injected at runtime
        public Logger logger
    
        /*
         * Perform a groovy service invocation
         *
         * return: the result object
         */
        Object invoke(SvcDef svcDef, HttpServletRequest request, User user, Map params) {
            JobAction jobAction = (JobAction) params.jobAction
            return invoke(svcDef, request, user, jobAction, params)
        }
    
        Object invoke(SvcDef svcDef, HttpServletRequest request, User user, JobAction jobAction, Map params) {
            logger.info params
            List<String> args = (List<String>) params.args
    
            def result = "Not Found"
    
            if( StringUtils.isNotEmpty(args[0]) &&
               StringUtils.isNotEmpty(args[1]) &&
               args[1].isNumber()) {
                def itemDelimited = args[0]
                // note repeat index from TM is 1 based not 0 based
                def repeatIndex = args[1].toInteger() - 1
                logger.info "itemDelimited: " + itemDelimited
                logger.info "repeatIndex: " + repeatIndex
    
                def items = itemDelimited.tokenize('|')
                logger.info "items: " + items
    
                result = items[repeatIndex.toInteger()]
                logger.info "result Item: " + result
            }
    
            return result
    
        }
    }
  7. Click Save to update the changes.

To create a Job Action Wait service using API:

Core API
com.avoka.fc.core.service.job.impl.JobTaskAssignService
com.avoka.fc.core.service.job.impl.GroovyJobActionService
For more information, see Core API
Fluent API
com.avoka.fc.core.service.fluent.FluentJobActionService
For more information, see Fluent API

You can use the following job action properties with the Job Task Assign service.

Name Description Example
Task Type A type of task to create, which can be an Anonymous, Form, or Review. { "name": "Task Type", "value": "Review" }
Task Form XML Data A form XML data, such as a schema seed. { "name": "Task Form XML Data", "value": "$func.startSubmissionXml()" }
Task Input XML Prefill An input pre-fill data XML which is mapped into the form XML data using prefill input XPath mappings. This property value is ignored for the Anonymous task type. { "name": "Task Input XML Prefill", "value": "$func.invoke('Job Prefill Service', $job)" }
Task Form Code A form code to assign in this task. Review tasks don't need to specify a Task Form Code, in which case the form code and form version from the previous submission are used.If a form code is specified without a form version, then the current form version is used. { "name": "Task Form Code", "value": "ABC123" }{ "name": "Task Form Code", "value": "$func.startFormCode()" }
Task Form Version This explicitly sets the form version of the form assigned in Task Form Code. This requires the Task Form Code to be specified. { "name": "Task Form Version", "value": "1" }
Task Review Previous Step Specifies whether to review a form submission of the previous step [ true | false ]. If true this will override the value in Task Review Submission step. This property is only valid with the Review task type. { "name": "Task Review Previous Step", "value": "true" }
Task Review Submission Step Specifies the name of the form submission step to review. Ignored if Task Review Previous Step is set to true. This property is only valid with the Review task type. { "name": "Task Review Submission Step", "value": "Application Start" }
Task Attachments Previous Step Specifies whether to copy of attachments from the submission of the previous step [ true | false ]. If true, it overrides the value in the Task Attachments Submission step. This property is ignored for a Review task which automatically copies attachments form the reviewed submission. { "name": "Task Attachments Previous Step", "value": "true" }
Task Attachments Submission Step Specifies the name of the form submission step to copy the attachments from. It's ignored if the Task Attachments Previous step is set to true. This property is also ignored for a Review task which automatically copies attachments form the reviewed submission. { "name": "Task Attachments Submission Step", "value": "Application Start" }
Task Assign Group This property is only valid with the Form or Review task types. The assigned task group name. A function can also specify the assigned group. { "name": "Task Assign Group", "value": "Initial Review Group" }{ "name": "Task Assign Group", "value": "$func.formProperty('Manager Review Group')" }
Task Assign Groups This property is only valid with the Form or Review task types. The assigned task groups. A function can also specify the assigned groups. { "name": "Task Assign Groups", "value": "Blue-Reviewers, Red-Reviewers" }{ "name": "Task Assign Groups", "value": "$func.formProperty('Reviewer Groups')" }
Task Assign Group Create Enables form groups to be automatically created if they don't already exist, and create submission group association. { "name": "Task Assign Groups", "value": "$formDataMap.assignGroups" }{ "name": "Task Assign Group Create", "value": "true" } { "name": "Task Assign Repeating", "value": "true" }
Task Assign User This property is only valid with the Form or Review task types. The assigned task user's login name, who must be an active user in Manager. { "name": "Task Assign User", "value": "johnsmith" }{ "name": "Task Assign User", "value": "$func.startUser()" }{ "name": "Task Assign User", "value": "$formDataMap.managerLoginName" }{ "name": "Task Assign User", "value": "$func.userForEmail($formDataMap.managerEmail)" }{ "name": "Task Assign User", "value": "$func.formProperty('Manager Login')" }
Task Assign Email This property is only valid with the Anonymous task type. The assigned task email for anonymous user email assignment. { "name": "Task Assign Email", "value": "[email protected]" }{ "name": "Task Assign Email", "value": "$formDataMap.doctorEmailAddress" }
Task Assign Repeating This property specifies whether the Task Assignment is repeating, and a task assignments should be performed to each assignment member, either Email, Group or User. This example assigns separate tasks to the App QA and App Reviewers groups. { "name": "Task Assign Group", "value": "App QA|App Reviewers" }{ "name": "Task Assign Repeating", "value": "true" }
Task Assign Repeat Item This property specifies the Task Assign Repeat Item, and its value is made available during the evaluation of other properties, such as ${assignRepeatItem}, and is stored in the JobAction record. This value can be used to differentiate task assignments during a repeating assignment. This data is also populated into the XML form data element, such as //SystemProfile/Job/AssignRepeatItem. { "name": "Task Assign Group", "value": "App QA|App Reviewers" }{ "name": "Task Assign Repeating", "value": "true" }{ "name": "Task Assign Repeat Item", "value": "$formDataMap.divisionChoice" }
Task Enable Claiming Enables group tasks to be claimed or assigned to individual users belonging to the task's groups. { "name": "Task Enable Claiming", "value": "true" }
Task Save Challenge This property is only valid with the Anonymous task type and is associated with the Anonymous save and the Task Assign Email properties. The save challenge question is configured in the form version. { "name": "Task Save Challenge", "value": "${formDataMap.email}" }
Task Assign Portal

A form space name to be used for the task assignment, which is:

  • Mandatory - for anonymous user email assignment
  • Optional - for users and a group assignment, as well as global forms  |  23.10 This feature was introduced in 23.10

If not specified, it uses the first form space assigned to the form. If it's a global form and its' an immediate process, it first checks whether there is a form space specified in a request.

{ "name": "Task Assign Portal", "value": "Maguire" }{ "name": "Task Assign Portal", "value": "$func.formProperty('Review Portal')" }
Task User Deletable Specifies whether the task can be deleted by the assignee [ true | false ]. If it is not set, the value is false. { "name": "Task User Deletable", "value": "true" }
Task Scheduled The task's scheduled time in the following format: yyyy-[m]m-[d]d. { "name": "Task Scheduled", "value": "2014-04-10" }
Task Expiry The task's expiry time in the following format: yyyy-[m]m-[d]d. { "name": "Task Expiry", "value": "2014-04-10" }
Task Menu Label The task menu label value for use in application bundle navigation menus. { "name": "Task Menu Label", "value": "Credit Card" }{ "name": "Task Menu Category", "value": "Products" }
Task Menu Category The task menu category for use in application bundle navigation menus to group related tasks into menus { "name": "Task Menu Label", "value": "Credit Card" }{ "name": "Task Menu Category", "value": "Products" }
Task Subject The task's subject and title. { "name": "Task Email Subject", "value": "Application Review Job" }{ "name": "Task Email Subject", "value": "$job.referenceNumber for $formDataMap.firstName $formDataMap.lastName" }
Task Message The task descriptive message. { "name": "Task Email Message", "value": "$job.referenceNumber for $formDataMap.firstName $formDataMap.lastName }
Task Sequence The sorted or ordered task's sequence number. { "name": "Task Sequence", "value": "1" }
Task Address The task location address. { "name": "Task Address", "value": "1a Rialto Lane, Manly, New South Wales" }
Task Latitude The task location latitude in decimal degrees. { "name": "Task Latitude", "value": "-33.79833" }
Task Longitude The task location longitude in decimal degrees. { "name": "Task Longitude", "value": "151.28723" }
Task Send Email Specifies whether a notification email should be sent to task assignees [ true | false ]. { "name": "Task Send Email", "value": "true" }
Task Email Message

The task email notification email message body template. The following model is used: submission (Submission): the previous submissionformDataMap: Map<String, String> the form data map for the submissiontask (Submission): the task submissionformat(EmailFormat): the email formatterportal (Portal): the Space (Portal), if the portal is specified or resolvedtaskUrl (String) the link to the newly created task, if portal specified or resolvedenvironmentName (String): the environment name deployment propertysupportEmail (String): the email for the default senderNote:Most of the time this property should be removed in which case it will use the "Email Task Notification Message" template property will be looked up in this order: form -> organization -> form space -> deployment property.

Adding large templates into the JobDefinition JSON can be problematic, so it's better to set an Email Task Notification Message property.

{ "name": "Task Email Message", "value": "$job.referenceNumber for $formDataMap.firstName $formDataMap.lastName" }{ "name": "Task Email Message", "value": '$job.referenceNumber for $formDataMap.firstName $formDataMap.lastNameclickhereto open your task' }{ "name": "Task Email Message", "value": "$func.formProperty('Assign review email message')" }
Task Email Subject

The task email notification subject template.The following model is used: submission (Submission): the previous submission formDataMap: Map<String, String> the form data map for the submission task (Submission): the task submission format(EmailFormat): the email formatter portal (Portal): the Space (Portal), if the portal is specified or resolvedtaskUrl (String) the link to the newly created task, if portal specified or resolvedenvironmentName (String): the environment name deployment propertysupportEmail (String): the email for the default senderNote:Most of the time this property should be removed in which case it will use the "Email Task Notification Subject" template property will be looked up in this order: form -> organization -> space (portal) -> deployment property.

Adding large templates into the JobDefinition JSON can be problematic. It may be better to set an Email Task Notification Subject property.

{ "name": "Task Email Subject", "value": "Application Review Job" } { "name": "Task Email Subject", "value": "$job.referenceNumber for $formDataMap.firstName $formDataMap.lastName" } { "name": "Task Email Subject", "value": "$func.formProperty('Assign review email subject')" }

For more information, see JobTaskAssignService core API.

Next, learn how to view all job services.