rest-api-context_1 2.6

Pierre-yves Monnet's picture

Release notes

2.6 Accept url parameter
return context.isTask / context.isOverview based on the URL parameter value
in case of instantiation, return the document variable empty (if context ask for anyvalue like '*').
return parameters (+ value) in the result

return context.isTask / context.isOverview based on the URL parameter value
in case of instantiation, return the document variable empty (if context ask for anyvalue like '*').
return parameters (+ value) in the result
--------------------------------- Url Parameter
To set the URL in the RestAPi Context, do the following:
- Create a Javascript variable "getUrl"
- give the Javascript :
var urlPath = window.location.pathname;
var urlPathEncode = encodeURI(urlPath);
return urlPathEncode;

  • in the RESTAPI CONTEXT, give this information:
    ../API/extension/context?taskId={{taskId}}&processId={{taskId}}&caseId={{taskId}}&url={{getUrl}}

    (assuming taskId is a variable "URL parameter" / value= "id"
    Nota : BonitaPortal give in the URL parameter ID different ID : this is the TASK ID of the task on the task execution, the caseId in the overviewcase, and the processId in the process instantiation
    The result is then
    "context": {
    "isTaskExecution": false,
    "isProcessInstanciation": true,
    "isProcessOverview": false,
    "isAdministrator": true,

    ------------------------------ Document
    In the instantiation form, when a document exist, return it empty. This information is needed for the FileUploadWidgetPlus

    ------------------------------ Parameters
    If requested (context required all like '*') then the process parameters are returned with the value.
    Else, return can be done only when requested

    DateTime is now new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ")

Downloads: 
97
Edition: 
BonitaBPM Version Compatibility: 
Testing
Notifications