Task State to filter WorkflowInstanceQuery

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2014 05:23 PM
In my activity bmpn i have some states such as "Start Process", "Review", "Second Review" and so on…
When i start the Workflow in Share i can navigate it through all states.
Now, how can i retrieve the current state in my custom webscript?
Here some code:
For example for the Review and Approve basic Alfresco's workflow the state i'm trying to retrieve are "Start Review", "In Review", "Approved", "Rejected"…
Someone have an idea?!
When i start the Workflow in Share i can navigate it through all states.
Now, how can i retrieve the current state in my custom webscript?
Here some code:
WorkflowInstanceQuery workflowInstanceQuery = new WorkflowInstanceQuery(); // get filter param valuesMap<QName, Object> filters = new HashMap<QName, Object>(9);if (req.getParameter(PARAM_TASK_STATE) != null){ filters.put(??????????, req.getParameter(PARAM_TASK_STATE));}workflowInstanceQuery.setCustomProps(filters);workflows.addAll(workflowService.getWorkflows(workflowInstanceQuery));
For example for the Review and Approve basic Alfresco's workflow the state i'm trying to retrieve are "Start Review", "In Review", "Approved", "Rejected"…
Someone have an idea?!
Labels:
- Labels:
-
Archive
3 REPLIES 3
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2014 05:35 AM
Param values added to customProps map will be parse as activiti global variable.
So if you had added PARAM_TASK_STATE into process instances global variable in you workflow,you can query using customProps
So if you had added PARAM_TASK_STATE into process instances global variable in you workflow,you can query using customProps
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2014 03:16 AM
Hi Dave984 , I have same problem with you , Do you solved it ?
Can you help me ! please give me your solution , this is my email fsoft.vangnd1@gmail.com
Many Thank
Can you help me ! please give me your solution , this is my email fsoft.vangnd1@gmail.com
Many Thank

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2014 03:38 AM
I have received message from Kaynezhang !
This is his solution , and my problem has resolve .
The brief process is like below:
1.Whenever state changing task such as "Start Review", "In Review", "Approved", "Rejected" is executed,persiste process variables (for example PROCESS_STATE) into database.
execution.setVariable("PROCESS_STATE",state);
2.Get workflow instances according to the state(global variables)
WorkflowInstanceQuery workflowInstanceQuery = new WorkflowInstanceQuery();
Map<QName, Object> customProps = new HashMap<QName, Object>(9);
workflowInstanceQuery.setCustomProps(customProps);
workflowService.getWorkflows(workflowInstanceQuery);
This is his solution , and my problem has resolve .
The brief process is like below:
1.Whenever state changing task such as "Start Review", "In Review", "Approved", "Rejected" is executed,persiste process variables (for example PROCESS_STATE) into database.
execution.setVariable("PROCESS_STATE",state);
2.Get workflow instances according to the state(global variables)
WorkflowInstanceQuery workflowInstanceQuery = new WorkflowInstanceQuery();
Map<QName, Object> customProps = new HashMap<QName, Object>(9);
workflowInstanceQuery.setCustomProps(customProps);
workflowService.getWorkflows(workflowInstanceQuery);
