Hello,
In general, I used the RestApiContext, which solve all theses questions.
But here, I have to analyze all the different options.
In a process, I have a BDM (let's say "invoice") and a process variable (let's say "commentOnInvoice").
I want to display in my case Overview these information.
------------------- Documentation
Reading https://documentation.bonitasoft.com/bonita/7.11/uid-case-overview-tutorial, I used the REST API
../API/bpm/archivedCase?c=1&d=started_by&d=processDefinitionId&f=sourceObjectId%3D{{caseId}}&p=0
but this REST API Does not return anything about variables.
For the BDM, in the task, we have a context. How's it working here? The documentation says nothing here.
-------------------- BDM
Thank to the default Overview page, I see this URL:
/bonita/portal/resource/processInstance/defaultoverview/1.0/API/bpm/case/15?d=started_by&d=startedBySubstitute&d=processDefinitionId
return information about the case, but no BDM pr process variable
/bonita/portal/resource/processInstance/defaultoverview/1.0/API/bpm/case/15/context
return the list of BDM ! Note the 15 is not the caseId, but the "Id of archived record".
In the documentation, the URL is /API/bpm/archivedCase/:archivedCaseId/context
but this URL return nothing
Same for ../API/bpm/case/{{caseid}}/context
Q1/ So, is the "portal/resource" is the only way? Keep in mind this URL is not documented (or I miss it somewhere?)
------------ Variable
According to the document, REST API is
/API/bpm/caseVariable/:caseId/:variableName
but when I used it, I got a 404 Not Found...
/bonita/API/bpm/caseVariable/12/commentOn
Toi get all variables, documentation say
/API/bpm/caseVariable?
and give an example:
/API/bpm/caseVariable?p=0&c=10&f=case\_id%3d11754
but when I run this example (replacing 11754 by 16) I got an exception
HTTP 400 Un caractère invalide a été trouvé dans la cible de la requête, les caractères valides sont définis dans RFC 7230 et RFC 3986
If I use
/API/bpm/caseVariable?p=0&c=10&f=case_id%3d16
I received:
{"exception":"class org.bonitasoft.web.toolkit.client.common.exception.api.APIException","message":"Error when getting case variables",
but for a active case, this is working.
Q2/ So how do I get the archived variable?
Thank you!