Toggle menu

Creating Custom Tasks

Add the Start Snippet

Add the "CM Multipurpose Start" snippet to the top of the first page of your form. There's no need to edit any of the fields.

Multipurpose Snippet Toolbox
 

Multipurpose Snippet Start
 

Advanced Feature - Case Process Variables

The snippet includes a caseProcessVars variable field. The field's default function is used to fetch process variables from the parent case that the task is started from. The limitTo array lets you enter the names of process variables that you would like to be available in your task. Do not leave this array blank or all variables will be retrieved. For example:

{
    processName: 'casemanagementv1',
    businessKey: helper.queryFieldValue('CASEBUSINESSKEY'),
    limitTo: ['form_SITE']
}

The variables you request are returned in a server-side form variable:

caseProcessVars = {
    "form_SITE": "Plymouth"
}
Which could be used in the default functions of other fields on your page:

Get Value of Task Variable
 

function(helper, defaultValue, currentValue) {
    var theValue;
    if (currentValue !== undefined) {
        theValue = currentValue;
    } else {
        theValue = helper.getVariable('caseProcessVars.form_SITE');
    }
    return theValue;
}

Last modified on June 29, 2023

Share this page

Facebook icon Twitter icon email icon

Print

print icon