public void notify(final DelegateTask delegateTask){ if(delegateTask.getExecution() == null) { LOG.taskNotRelatedToExecution(delegateTask); } else { final DelegateExecution execution = delegateTask.getExecution(); Callable<Void> notification = new Callable<Void>() { public Void call() throws Exception { notifyTaskListener(delegateTask); return null; } }; try { performNotification(execution, notification); } catch(Exception e) { throw LOG.exceptionWhileNotifyingPaTaskListener(e); } } }
public void notify(DelegateTask task) { DelegateExecution execution = task.getExecution(); recordedEvents.add(new RecordedTaskEvent(task.getId(), task.getExecutionId(), task.getEventName(), execution.getActivityInstanceId())); }
public void notify(final DelegateTask delegateTask){ if(delegateTask.getExecution() == null) { LOG.taskNotRelatedToExecution(delegateTask); } else { final DelegateExecution execution = delegateTask.getExecution(); Callable<Void> notification = new Callable<Void>() { public Void call() throws Exception { notifyTaskListener(delegateTask); return null; } }; try { performNotification(execution, notification); } catch(Exception e) { throw LOG.exceptionWhileNotifyingPaTaskListener(e); } } }
public void notify(DelegateTask task) { DelegateExecution execution = task.getExecution(); recordedEvents.add(new RecordedTaskEvent(task.getId(), task.getExecutionId(), task.getEventName(), execution.getActivityInstanceId())); }
public void notify(DelegateTask delegateTask) { delegateTask.getExecution().setVariable("greeting", "Hello from " + greeter.getValue(delegateTask.getExecution())); delegateTask.getExecution().setVariable("shortName", shortName.getValue(delegateTask.getExecution())); delegateTask.setVariableLocal("myTaskVariable", "test"); }
public void notify(DelegateTask delegateTask) { DelegateExecution execution = delegateTask.getExecution(); String newKeyValue = (String) execution.getVariable(BUSINESS_KEY_VARIABLE); execution.setProcessBusinessKey(newKeyValue); }
@SuppressWarnings("unchecked") public void notify(DelegateTask delegateTask) { // get mapping table from variable DelegateExecution execution = delegateTask.getExecution(); Map<String, String> assigneeMappingTable = (Map<String, String>) execution.getVariable("assigneeMappingTable"); // get assignee from process String assigneeFromProcessDefinition = delegateTask.getAssignee(); // overwrite assignee if there is an entry in the mapping table if (assigneeMappingTable.containsKey(assigneeFromProcessDefinition)) { String assigneeFromMappingTable = assigneeMappingTable.get(assigneeFromProcessDefinition); delegateTask.setAssignee(assigneeFromMappingTable); } }
@Override public void notify(DelegateTask delegateTask) { DelegateExecution execution = delegateTask.getExecution(); execution.setVariable("varName", "varValue", "activityId"); assertThat(execution.getVariableLocal("varName"), is(notNullValue())); } }
public void notify(DelegateTask delegateTask) { // Note: we can't cache the result of the expression, because the // execution can change: eg. delegateExpression='${mySpringBeanFactory.randomSpringBean()}' VariableScope variableScope = delegateTask.getExecution(); if (variableScope == null) { variableScope = delegateTask.getCaseExecution(); } Object delegate = expression.getValue(variableScope); applyFieldDeclaration(fieldDeclarations, delegate); if (delegate instanceof TaskListener) { try { Context.getProcessEngineConfiguration() .getDelegateInterceptor() .handleInvocation(new TaskListenerInvocation((TaskListener)delegate, delegateTask)); }catch (Exception e) { throw new ProcessEngineException("Exception while invoking TaskListener: "+e.getMessage(), e); } } else { throw new ProcessEngineException("Delegate expression " + expression + " did not resolve to an implementation of " + TaskListener.class ); } }
public void notify(DelegateTask delegateTask) { // Note: we can't cache the result of the expression, because the // execution can change: eg. delegateExpression='${mySpringBeanFactory.randomSpringBean()}' VariableScope variableScope = delegateTask.getExecution(); if (variableScope == null) { variableScope = delegateTask.getCaseExecution(); } Object delegate = expression.getValue(variableScope); applyFieldDeclaration(fieldDeclarations, delegate); if (delegate instanceof TaskListener) { try { Context.getProcessEngineConfiguration() .getDelegateInterceptor() .handleInvocation(new TaskListenerInvocation((TaskListener)delegate, delegateTask)); }catch (Exception e) { throw new ProcessEngineException("Exception while invoking TaskListener: "+e.getMessage(), e); } } else { throw new ProcessEngineException("Delegate expression " + expression + " did not resolve to an implementation of " + TaskListener.class ); } }
@Override public void notify(DelegateTask delegateTask) { try { // then (see #testRemoveExecutionSequence) StringValue var = delegateTask.getExecution().getVariableLocalTyped("localVar"); assertEquals("localVarVal", var.getValue()); } catch (NullPointerException e) { fail("Local variable shouldn't be null."); } } }
@Override void setValueIntoDictionary(Dictionary<String, String> dictionary, DelegateTask task) { if (task.getExecution().getCurrentTransitionId() != null) { dictionary.put(getPropertyKey(), task.getExecution().getCurrentTransitionId()); } } },
@Override void setValueIntoDictionary(Dictionary<String, String> dictionary, DelegateTask task) { dictionary.put(getPropertyKey(), task.getExecution().getCurrentActivityId()); } },
public void notify(final DelegateTask delegateTask){ if(delegateTask.getExecution() == null) { LOG.taskNotRelatedToExecution(delegateTask); } else { final DelegateExecution execution = delegateTask.getExecution(); Callable<Void> notification = new Callable<Void>() { public Void call() throws Exception { notifyTaskListener(delegateTask); return null; } }; try { performNotification(execution, notification); } catch(Exception e) { throw LOG.exceptionWhileNotifyingPaTaskListener(e); } } }
/** * Implementation of the event dispatching. * * @param delegateExecution * process execution */ public final void notify(DelegateTask delegateTask) { Guards.dispatch(this, delegateTask.getEventName(), delegateTask.getExecution()); } }
public void notify(DelegateTask delegateTask) { delegateTask.getExecution().setVariable("greeting", "Hello from " + greeter.getValue(delegateTask.getExecution())); delegateTask.getExecution().setVariable("shortName", shortName.getValue(delegateTask.getExecution())); delegateTask.setVariableLocal("myTaskVariable", "test"); }
public void notify(DelegateTask delegateTask) { DelegateExecution execution = delegateTask.getExecution(); String newKeyValue = (String) execution.getVariable(BUSINESS_KEY_VARIABLE); execution.setProcessBusinessKey(newKeyValue); }
@SuppressWarnings("unchecked") public void notify(DelegateTask delegateTask) { // get mapping table from variable DelegateExecution execution = delegateTask.getExecution(); Map<String, String> assigneeMappingTable = (Map<String, String>) execution.getVariable("assigneeMappingTable"); // get assignee from process String assigneeFromProcessDefinition = delegateTask.getAssignee(); // overwrite assignee if there is an entry in the mapping table if (assigneeMappingTable.containsKey(assigneeFromProcessDefinition)) { String assigneeFromMappingTable = assigneeMappingTable.get(assigneeFromProcessDefinition); delegateTask.setAssignee(assigneeFromMappingTable); } }
@Override public void notify(DelegateTask delegateTask) { DelegateExecution execution = delegateTask.getExecution(); execution.setVariable("varName", "varValue", "activityId"); assertThat(execution.getVariableLocal("varName"), is(notNullValue())); } }
@Override public void notify(DelegateTask delegateTask) { try { // then (see #testRemoveExecutionSequence) StringValue var = delegateTask.getExecution().getVariableLocalTyped("localVar"); assertEquals("localVarVal", var.getValue()); } catch (NullPointerException e) { fail("Local variable shouldn't be null."); } } }