[Java] Get task id after workflow start

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-02-2013 08:36 AM
Hi everybody!
I'm trying to develop a Java backed webscript that starts a new workflow and redirects the user to the 'task-edit' page for the first 'userTask'.
In the method
The list
Moreover, if I redirect the user on another webscript and execute the query from there, it works.
Someone could explain me this behaviour? There's another way to accomplish my need?
Thanks,
Alessandro
I'm trying to develop a Java backed webscript that starts a new workflow and redirects the user to the 'task-edit' page for the first 'userTask'.
In the method
executeImpl‍
, I start a new workflow and subsequently end the start task. Now the active task should be the one following the start task, so I query for it:WorkflowTaskQuery query = new WorkflowTaskQuery();query.setActive(null);query.setWorkflowDefinitionName("activiti$cdGroupMeeting");query.setTaskState(WorkflowTaskState.IN_PROGRESS);List<WorkflowTask> tasks = serviceRegistry.getWorkflowService().queryTasks(query, true);‍‍‍‍‍‍‍
The list
tasks‍
is empty. What's wrong?Moreover, if I redirect the user on another webscript and execute the query from there, it works.
Someone could explain me this behaviour? There's another way to accomplish my need?
Thanks,
Alessandro
Labels:
- Labels:
-
Archive
4 REPLIES 4

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-11-2013 06:14 AM
Maybe is too early to query for the first task right after the start task end.
Alfresco (or Activiti) might need some time to update workflow data…
Any thoughts?
Alfresco (or Activiti) might need some time to update workflow data…
Any thoughts?

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-18-2013 11:28 AM
Nobody have had the same problem?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-18-2013 11:38 PM
Try
method
org.alfresco.service.cmr.workflow.WorkflowService.getStartTask(String workflowInstanceId);‍‍‍
method

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-11-2014 12:56 PM
Any ideas.
Me too i need to start from the task after the start task. how can i do that
Than you for your help
Me too i need to start from the task after the start task. how can i do that
Than you for your help
