11-11-2013 03:26 PM
Hi, I created a event listener and this listen workflowTaskEnded event. In this listener I can not get all my workflow and node variables values, only can get variable comment value.
Why when you fire workflowTaskAssigned event, you add workflow variables and node variables, but when you fire workflowTaskCompleted event, those varialbes are not added as parameters on event context?
Why only variable comment?
@Override
public void endTask(CoreSession session, Task task,
Map<String, Object> data, String status) throws ClientException {
String comment = (String) data.get("comment");
TaskService taskService = Framework.getLocalService(TaskService.class);
taskService.endTask(session, (NuxeoPrincipal) session.getPrincipal(),
task, comment, TaskEventNames.WORKFLOW_TASK_COMPLETED, false);
Map<String, String> taskVariables = task.getVariables();
String routeInstanceId = taskVariables.get(DocumentRoutingConstants.TASK_ROUTE_INSTANCE_DOCUMENT_ID_KEY);
if (StringUtils.isEmpty(routeInstanceId)) {
throw new DocumentRouteException(
"Can not resume workflow, no related route");
}
completeTask(routeInstanceId, null, task.getId(), data, status,
session);
}
12-16-2013 06:44 AM
Hello,
You can find some examples in the documentation: How to modify a workflow variable outside of workflow context.
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.