0

I am trying to get the start date of an archived task via the API Rest of Bonita BPM portal (7.1.3 version) but I don't find the proper method.

For example, I am using:

.../bonita/API/bpm/archivedTask?p=0&f=processId=processIdNumber

and the only dates that I get are:

[
    {
        ...
        "assigned_date": "2016-10-13 12:22:50.456",
        ...
        "reached_state_date": "2016-10-13 12:22:51.717",
        ...
        "archivedDate": "2016-10-13 12:22:51.729",
        ...
        "dueDate": "2016-10-13 13:21:31.266",
        "last_update_date": "2016-10-13 12:22:51.717"
    }
]

Neither of these dates is the start date.

Any idea?

Thanks a lot. Best regards.

1 Answers1

1

Actually the archivedTask API only return the latest state of the archived task. A human task go through 3 states: initializing, ready and completed. archivedTask API only return information about the completed state.

What you want is probably the reached_state_date of the ready state.

Solution is to use the archivedFlowNode API that will return an array with one entry per state.

Here is an example to filter for a specific case id (i.e. running process instance, e.g. 123), a specific task name (e.g. Step1) and to get only ready state information (you can limit c value to 1 instead of 10 as you probably only expect one result):

/API/bpm/archivedFlowNode?p=0&c=10&f=caseId%3d123&f=state%3dready&f=name%3dStep1

Note that %3d is the = sign URL encoded.

Also note that caseId is the id of the running case. If you only have the id of the archived case, you can get it by calling the following API:

/API/bpm/archivedCase/456

where 456 is the archived case id. On the response case id is stored in sourceObjectId attribute.

Antoine Mottier
  • 1,185
  • 1
  • 8
  • 13