Please enable JavaScript to view this site.

The manual for the JobRouter developer

For detecting the steps, that are currently available for the authenticated user, the following GET route is available:

/application/workitems/inbox – List of steps in the general inbox

/application/workitems/start – List of available start steps

/application/workitems/completed – List of already processed steps

/application/workitems/substitution List of steps, which the user may edit as a representative

/application/workitems/:processName/:version/:inboxId List of steps available in the stated process inbox. Thereby, the process name is shown as parameter processName, the process version as parameter version, and the box ID as parameter inboxId.

The response is in JSON format and contains the properties of the single steps. Which properties are shown in the respective box is described in the Workflow Design Manual. Not all steps are returned at once, but only as many steps are returned as configured in the JobRouter setting Number of Rows. By specifying the page number as GET parameter further steps can be determined (e.g. .../inbox?page=2).

{

    "meta": {

        "pagination": {

            "total": 62,

            "from": 0,

            "to": 25,

            "page": 1,

            "pageCount": 3,

            "limit": 25

        }

    },

    "workitems": [

        {

            "jrincident": "134",

            "jrindate": "2017-09-03T14:36:15+02:00",

            "jrsteplabel": "Display archived documents",

            "jrprocessname": "archiveDocument",

            "jrworkflowid": "4c057f28ebc1740d5334bff12ddfe8870000000005",

            "jrlastuser": "jdoe",

            "jrurl": "/jobrouter/index.php?cmd=DirectOpen&workflowid=4c...",

            ... further properties ...

        },

        ... further steps in the box ...

    ]

}

Example: Determine inbox steps

guzzlehttp

// User has been authenticated already

 

try {

 

    $response = $client->request('GET', 'application/workitems/inbox);

 

    $body = json_decode($response->getBody(), true);

 

    echo "Number of steps in the inbox: ";

    echo $body['meta']['pagination']['total'] . "\n\n";

 

    foreach ($body['workitems'] as $item) {

        echo "Process name: " . $item['jrprocessname'] . "\n";

        echo "Step label: " . $item['jrsteplabel'] . "\n";

        echo "Workflow ID: " . $item['jrworkflowid'] . "\n\n";

    }

} catch (Exception $e) {

    echo "Error during performance: " . $e->getMessage() . "\n";

}

 

// Finish user session

cURL

// User has been authenticated already

 

curl_setopt($curlHandle, CURLOPT_URL,

    'http://example.org/jobrouter/api/rest/v2/application/workitems/inbox');

curl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, true);

curl_setopt($curlHandle, CURLOPT_CUSTOMREQUEST, 'GET');

curl_setopt($curlHandle, CURLOPT_COOKIEFILE, 'path/to/cooke/file.cookie');

 

$response = curl_exec($curlHandle);

$statusCode = curl_getinfo($curlHandle, CURLINFO_HTTP_CODE);

 

curl_close();

 

if ($statusCode == 200) {

    $boxData = json_decode($response, true);

    echo "Number of steps in the inbox: ";

    echo $boxData['meta']['pagination']['total'] . "\n\n";

 

    foreach ($boxData['workitems'] as $item) {

        echo "Process name: " . $item['jrprocessname'] . "\n";

        echo "Step label: " . $item['jrsteplabel'] . "\n";

        echo "Workflow ID: " . $item['jrworkflowid'] . "\n\n";

    }

} else {

    echo "Error during performance:  Code - " . $statusCode . ", ";

    echo "Response: " . var_export($response, true);

}

 

// Finish user session