Job Task Wait Action 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 and configure job task wait action services, which are specialized job action services designed to block the execution of a collaboration job until a specified event takes place.

To create a job action service:

  1. Select Services > Job Services.
  2. Click New to create a job service.
  3. Select the Job Task Wait Action as a service type from the Service Type dropdown list.
  4. Select the Fluent Job Action template from the Service Template dropdown list.
  5. Select an organization from the Organization dropdown list.
  6. Click Save to update the changes.

To configure a job action service:

  1. Locate a job action service.
  2. Configure the service definition.
  3. Select the new service type to assign a Fluent or Groovy job action to a new type, such as Job Expiry Service or Job Task Wait.
  4. 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" }
              ]
            }
  5. The $func.invoke method executes the Repeating Get Item service (invoking it by the name) with two parameters.

  6. Click the Job Services tab to view the Repeating Get Item service used in the action definition.
  7. 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
    
        }
    }
  8. Click Save to update the changes.

Next, learn how to view all job services.