Deleted.

cancel
Showing results for 
Search instead for 
Did you mean: 
anon26949
Established Member
1 Solution

Accepted Solutions
afaust
Master

Re: How to get the ID of the process instance in the controller?

Jump to solution

You can find the person nodes that represent the assignees using search services (this is how the "People" search works) - but you cannot search e.g. for any tasks using the assignee or somehow query for any relations between process information and regular nodes. All the process information is kept in a separate structure that currently is not covered in any way by indexing / search.

Note: The ID from a task in an Activiti TaskListener / delegate is NOT the full ID. It is only the internal Activiti ID, which is the number after the $ character. Since Alfresco is technically capable of working with multiple, different workflow engines under the hood, they prepend the name of the engine to the ID to come up with the global ID of activiti$12345. In your code you can use the BPMEngineRegistry.createGlobalId(String, String) operation to turn a local ID (from Activiti code) into a global ID (what Alfresco uses in its APIs). The ActivitiConstants.ENGINE_ID is the constant to be used for the name of the engine in those IDs.

View solution in original post

6 Replies
mehe
Senior Member II

Re: How to queries all the assignments from the repository?

Jump to solution

I'm not shure if you find the assignees using search services - but you can, if you use the workflow service. I tried the new Alfresco REST API to get Informations about the tasks/workflows and got the assignees from the json entries.

use   ...alfresco/api/-default-/public/workflow/versions/1/tasks REST-Url as a starting point. The api-explorer (https://api-explorer.alfresco.com/api-explorer) should give you all information about the REST api you need.

But I'm not shure if I got your question fully...

afaust
Master

Re: How to get the ID of the process instance in the controller?

Jump to solution

You can find the person nodes that represent the assignees using search services (this is how the "People" search works) - but you cannot search e.g. for any tasks using the assignee or somehow query for any relations between process information and regular nodes. All the process information is kept in a separate structure that currently is not covered in any way by indexing / search.

Note: The ID from a task in an Activiti TaskListener / delegate is NOT the full ID. It is only the internal Activiti ID, which is the number after the $ character. Since Alfresco is technically capable of working with multiple, different workflow engines under the hood, they prepend the name of the engine to the ID to come up with the global ID of activiti$12345. In your code you can use the BPMEngineRegistry.createGlobalId(String, String) operation to turn a local ID (from Activiti code) into a global ID (what Alfresco uses in its APIs). The ActivitiConstants.ENGINE_ID is the constant to be used for the name of the engine in those IDs.

anon26949
Established Member

Deleted.

Jump to solution

Deleted.

anon26949
Established Member

Re: How to get the ID of the process instance in the controller?

Jump to solution

Thank you very much for your answer!..

I'm getting the whole list by using http://localhost:8080/alfresco/api/-default-/public/workflow/versions/1/tasks

Here's entries that was interested for me:

{"entry":
    {
        "dueAt":"2017-03-12T20:00:00.000+0000",
        "processDefinitionId":"contractsApproval:112:26204",
        "processId":"26205",
        "name":"Review Task",
        "description":"message... ",
        "startedAt":"2017-03-13T07:03:12.288+0000",
        "id":"26279",
        "assignee":"first",
        "state":"claimed",
        "activityDefinitionId":
        "reviewTask",
        "priority":1,
        "formResourceKey":"mswf:activitiReviewTask"
    }
},

{"entry":
    {
        "dueAt":"2017-03-12T20:00:00.000+0000",
        "processDefinitionId":"contractsApproval:112:26204",
        "processId":"26205",
        "name":"Review Task",
        "description":"message...",
        "startedAt":"2017-03-13T07:03:12.358+0000",
        "id":"26310",
        "assignee":"second",
        "state":"claimed",
        "activityDefinitionId":"reviewTask",
        "priority":1,
        "formResourceKey":"mswf:activitiReviewTask"
    }
}
afaust
Master

Re: How to get the ID of the process instance in the controller?

Jump to solution

When you use the workflow service Java API you always get entities as the result that contain an ID property, which will always be the global ID with the engine name prefixed to the technical ID from Activiti. This information should also be available in all the ReST APIs that deal with workflows - either new v1 ReST API or the internal APIs for Share, since Share must use the task ID to determine which form to show and what transition to trigger when the user processes the task.

anon26949
Established Member

Deleted.

Jump to solution

Deleted.

Alfresco Content Services Forum