As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
@Override public void onEvent(final ActivitiEvent event) { final ActivitiActivityEvent eventImpl = (ActivitiActivityEvent) event; if ("serviceTask".equals(eventImpl.getActivityType())) { final ProcessInstanceQuery processInstanceQuery = event.getEngineServices().getRuntimeService() .createProcessInstanceQuery().processInstanceId(event.getProcessInstanceId()) .includeProcessVariables(); final ProcessInstance processInstance = processInstanceQuery.singleResult(); if (processInstance == null) { this.log.warning("Unable to retrieve the process instance for which a service task starts."); } else { final Map<String, Object> processVariables = processInstance.getProcessVariables(); … } } }