webapp/workflow/view/completeTask.js
// The one above is currently not used in the application.
The one above is currently not used in the application.
The one above is currently not used in the application .
function completeWorkflowTask(taskId, formName, fields, processInstanceId, processDefinitionKey)
{
    var form = document.forms[formName];
    var parameters = {};
    for (i = 0, len = fields.length; i < len; i++)
    {
        parameters[fields[i]] = form[fields[i]].value;
    }
    var returnURLParams = {
        processInstanceId: processInstanceId,
        processDefinitionKey: processDefinitionKey
    };
    Ext4.Ajax.request({
        url: LABKEY.ActionURL.buildURL('workflow', 'completeTask'),
        method: 'POST',
        jsonData: {
            taskId: taskId,
            processVariables: parameters
        },
        returnUrl: LABKEY.ActionURL.buildURL('workflow', 'processInstance', null, returnURLParams),
        scope: this,
        success: function(response) {
            window.location = LABKEY.ActionURL.buildURL('workflow', 'processInstance', null, returnURLParams);
        },
        failure: function(response)
        {
            var jsonResp = LABKEY.Utils.decode(response.responseText);
            if (jsonResp && jsonResp.errors)
            {
                var errorHTML = jsonResp.errors[0].message;
                Ext4.Msg.alert('Error', errorHTML);
            }
        }
    });
}
function completeWorkflowTask ( taskId , formName , fields , processInstanceId , processDefinitionKey ) { var form = document . forms [ formName ] ; var parameters = { } ; for ( i = 0 , len = fields . length ; i < len ; i ++ ) { parameters [ fields [ i ] ] = form [ fields [ i ] ] . value ; } var returnURLParams = { processInstanceId : processInstanceId , processDefinitionKey : processDefinitionKey } ; Ext4 . Ajax . request ( { url : LABKEY . ActionURL . buildURL ( 'workflow' , 'completeTask' ) , method : 'POST' , jsonData : { taskId : taskId , processVariables : parameters } , returnUrl : LABKEY . ActionURL . buildURL ( 'workflow' , 'processInstance' , null , returnURLParams ) , scope : this , success : function ( response ) { window . location = LABKEY . ActionURL . buildURL ( 'workflow' , 'processInstance' , null , returnURLParams ) ; } , failure : function ( response ) { var jsonResp = LABKEY . Utils . decode ( response . responseText ) ; if ( jsonResp && jsonResp . errors ) { var errorHTML = jsonResp . errors [ 0 ] . message ; Ext4 . Msg . alert ( 'Error' , errorHTML ) ; } } } ) ; }
The one above is currently not used in the application.
The one above is currently not used in the application .