Query WorkflowTasks by Owner (Java API) [Solved]
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2013 02:09 PM
Hello there…
I'm trying to query tasks for a given owner with the following approach:
In "HELP HERE" I tried to pass to person NodeRef or just the username… but in both cases the query did not retrieved data. If I remove the query.setTaskCustomProps it works ok, thus I assume the rest is correct.
So… what's the correct value/object in customProps associated to the owner key?
thanks in advance
I'm trying to query tasks for a given owner with the following approach:
…NodeRef person = personService.getPerson("username");WorkflowTaskQuery query = new WorkflowTaskQuery();query.setActive(true);query.setTaskState(WorkflowTaskState.IN_PROGRESS);query.setTaskName(QName.createQName("http://www.myorg.com/model/workflow/1.0", "myTask")); Map<QName, Object> queryTaskCustomProps = new HashMap<QName, Object>();queryTaskCustomProps.put(ContentModel.PROP_OWNER, "HELP HERE"); query.setTaskCustomProps(queryTaskCustomProps); List<WorkflowTask> results = workflowService.queryTasks(query, false);…
In "HELP HERE" I tried to pass to person NodeRef or just the username… but in both cases the query did not retrieved data. If I remove the query.setTaskCustomProps it works ok, thus I assume the rest is correct.
So… what's the correct value/object in customProps associated to the owner key?
thanks in advance
Labels:
- Labels:
-
Archive
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2013 02:53 PM
Well, a simple WorkflowTaskQuery.setActorId("username") [sorry, i'm still a beginner] solves that problem… however another doubt related to setTaskCustomProps: how to query tasks for a specific group?
Debugging (printing the properties map), i saw a property {http://www.alfresco.org/model/bpm/1.0}pooledActors with a value like this: workspace://SpacesStore/GROUP_NAME.
To query, i will need to pass the nodeRef (like the value above) or just the group name?
If you have links to tutorials and/or documentation to indicate, related to this issue… i really appreciate
Debugging (printing the properties map), i saw a property {http://www.alfresco.org/model/bpm/1.0}pooledActors with a value like this: workspace://SpacesStore/GROUP_NAME.
To query, i will need to pass the nodeRef (like the value above) or just the group name?
…queryTaskCustomProps.put(QName.createQName(NamespaceService.BPM_MODEL_1_0_URI, "pooledActors"), "MY_GROUP NAME OR NODEREF");query.setTaskCustomProps(queryTaskCustomProps);…
If you have links to tutorials and/or documentation to indicate, related to this issue… i really appreciate
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2013 03:04 PM
Solved using:
workflowService.getPooledTasks("GROUP_NAME")
…
workflowService.getPooledTasks("GROUP_NAME")
…
