Processes

This page details the Processes endpoints and the actions they support. It provides sample URLs and results for quick reference, along with further instructions on how to use each endpoint.

web/json/workflow/process/abort/(*:processId)

 A running process instance.

  • User Role: Admin
  • Method: HTTP POST
  • Parameters: 
    • callback - (Optional) a function (in JavaScript) to call back after invoking this method
    • processId - Process instance id
  • Sample URL: 
    http://localhost:8080/jw/web/json/workflow/process/abort/208_crm_process1
  • Sample Result:
{"status":"aborted","processId":"208_crm_process1"}

 

web/json/workflow/process/latest/(*:processDefId)

Gets the latest Process def Id of a process based on a Process def Id.

  • User Role: Admin
  • Method: HTTP GET/POST
  • Parameters: 
    • callback - (Optional) a function (in JavaScript) to call back after invoking this method
    • processDefId - Process Definition Id (Replace '#' with ':' in the id)
  • Sample URL: http://localhost:8080/jw/web/json/workflow/process/latest/crm:1:process1
  • Sample Result: 
{"id":"crm#3#process1","encodedId":"crm:3:process1"}

 

web/json/workflow/process/list

Retrieves process list.

  • User Role: Admin
  • Method: HTTP GET/POST
  • Parameters: 
    • callback - (Optional) a function (in JavaScript) to call back after invoking this method
    • allVersion - (Optional) "yes" to load all versions, "no" to load the latest version
    • packageId - (Optional) package id (App id)
    • sort - (Optional) column name to be sorted
    • desc - (Optional) Boolean value to determine whether to sort by ascending or descending order (true equals to descending)
    • start - (Optional) where rows start from
    • rows - (Optional) number of rows per page
    • checkWhiteList - (Optional true/false) to return the list based on process white list
  • Sample URL: http://localhost:8080/jw/web/json/workflow/process/list
  • Sample Result: 
{
    "total": 3,
    "desc": false,
    "sort": "name",
    "start": 0,
    "data": [{
        "id": "hdc_v1001#1#hdc_certification_process",
        "packageName": "halal certification",
        "name": "HDC Certification Process",
        "packageId": "hdc_v1001",
        "label": "HDC Certification Process ver 1",
        "version": "1"
    }, {
        "id": "mdec_v1002#12#mdec_wp1",
        "packageName": "Mdec Work Progress",
        "name": "mdec_wp1",
        "packageId": "mdec_v1002",
        "label": "mdec_wp1 ver 12",
        "version": "12"
    }, {
        "id": "mora#5#mora_new_application",
        "packageName": "MORA Halal Certification",
        "name": "MORA New Application",
        "packageId": "mora",
        "label": "MORA New Application ver 5",
        "version": "5"
    }]
}

 

web/json/workflow/process/list/package

Retrieve the first process with details of every package.

  • User Role: Admin
  • Method: HTTP GET/POST
  • Parameters: 
    • callback - (Optional) a function (in JavaScript) to call back after invoking this method
    • checkWhiteList - (Optional) Boolean value to return the list based on process white list
  • Sample URL: http:/localhost:8080/jw/web/json/workflow/process/list/package
  • Sample Result:
{
    "data": [{
        "id": "hr_expense",
        "count": 2,
        "processVersion": "3",
        "packageName": "HR Expenses Claim App",
        "processId": "hr_expense#3#process1",
        "processName": "Expense Approval Process",
        "packageId": "hr_expense",
        "label": "HR Expenses Claim App",
        "url": "/json/workflow/process/list?packageId=hr_expense"
    }, {
        "id": "isr",
        "count": 1,
        "processVersion": "2",
        "packageName": "ISR",
        "processId": "isr#2#isr",
        "processName": "ISR Process",
        "packageId": "isr",
        "label": "ISR",
        "url": "/json/workflow/process/list?packageId=isr"
    }, {
        "id": "hrleave",
        "count": 2,
        "processVersion": "1",
        "packageName": "JINC Leave Solution",
        "processId": "hrleave#1#la",
        "processName": "Leave Application System",
        "packageId": "hrleave",
        "label": "JINC Leave Solution",
        "url": "/json/workflow/process/list?packageId=hrleave"
    }]
}

 

web/json/workflow/process/start/(*:processDefId)

Starts a process based on the process start whitelist.

  • User Role: Anyone (Including anonymous)  
  • Method: HTTP POST
  • Parameters: 
    • callback - (Optional) a function (in JavaScript) to call back after invoking this method
    • processDefId - Process Definition Id (Replace '#' with ':' in the id)

       

      Obtaining Latest Published Process Version

      Instead of specifying crm:3:process1 in the call, we can use the keyword latest in the processDefId - crm:latest:process1 to automatically set to the published app's process version.

    • processInstanceId - (Optional) used to start the previous created but hasn't started process instance
    • recordId - (Optional) used to start a process instance with an existing record
    • var_* - (Optional) parameters prefixed with "var_" will be used to set a workflow variable
  • Sample URL: 
  • http://localhost:8080/jw/web/json/workflow/process/start/crm:3:process1
  • Sample Result:
{"activityId":"885_224_crm_process1_approve_proposal","processId":"224_crm_process1"}
For "activityId" to be returned, please ensure the "Show The Next Assignment When Completed" is checked under the Run Process activity in Map Activities to Forms tab and the next activity after the start of process is assigned to the same person that starts the process.

 

web/json/workflow/process/variable/(*:processId)/(*:variable)

Sets workflow variable of a process instance.

  • User Role: Admin
  • Method: HTTP POST
  • Parameters: 
    • callback - (Optional) a function (in JavaScript) to call back after invoking this method
    • processId - process instance id
    • variable - workflow variable name 
    • value - value of workflow variable to be set
  • Sample URL:
  • http://localhost:8080/jw/web/json/workflow/process/variable/208_crm_process1/status?value=test
  • Sample Result:
{"status" : "variableSet"}

 

web/json/workflow/process/view/(*:processId)

Retrieves information of a process definition.

  • User Role: Admin
  • Method: HTTP GET/POST
  • Parameters: 
    • callback - (Optional) a function (in JavaScript) to call back after invoking this method
    • processId - Process Definition Id (Replace '#' with ':' in the id)
  • Sample URL: http://localhost:8080/jw/web/json/workflow/process/view/crm:3:process1
  • Sample Result: 
{
    "packageName": "CRM",
    "processId": "crm#3#process1",
    "name": "Proposal Approval Process",
    "packageId": "crm",
    "version": "3"
}

 

web/json/workflow/variable/list/(*:processId)

Retrieves all variables of a process instance.

  • User Role: Admin
  • Method: HTTP GET/POST
  • Parameters: 
    • callback - (Optional) a function (in JavaScript) to call back after invoking this method
    • processId - process instance id
  • Sample URL: http://localhost:8080/jw/web/json/workflow/variable/list/208_crm_process1
  • Sample Result:
{
    "processId": "208_crm_process1",
    "variable": {
        "status": "approved"
    }
}

 

Created by Damian Last modified by Aadrian on Dec 13, 2024