protected void handleException(DelegateExecution execution, String msg, Exception e, boolean doIgnoreException, String exceptionVariable) { if (doIgnoreException) { LOG.info("Ignoring email send error: " + msg, e); if (exceptionVariable != null && exceptionVariable.length() > 0) { execution.setVariable(exceptionVariable, msg); } } else { if (e instanceof ActivitiException) { throw (ActivitiException) e; } else { throw new ActivitiException(msg, e); } } } }
public void evaluate(DelegateExecution execution) { Object value = this.transformation.getValue(execution); execution.setVariable(this.getTarget(), value); } }
public void executeCommand(DelegateExecution execution) throws Exception { if (argList != null && argList.size() > 0) { ProcessBuilder processBuilder = new ProcessBuilder(argList); processBuilder.redirectErrorStream(getRedirectErrorFlag()); if (getCleanEnvBoolean()) { Map<String, String> env = processBuilder.environment(); env.clear(); } if (getDirectoryStr() != null && getDirectoryStr().length() > 0) processBuilder.directory(new File(getDirectoryStr())); Process process = processBuilder.start(); if (getWaitFlag()) { int errorCode = process.waitFor(); if (getResultVariableStr() != null) { String result = convertStreamToStr(process.getInputStream()); execution.setVariable(getResultVariableStr(), result); } if (getErrorCodeVariableStr() != null) { execution.setVariable(getErrorCodeVariableStr(), Integer.toString(errorCode)); } } } }
protected void initializeIoSpecification(IOSpecification activityIoSpecification, DelegateExecution execution, BpmnModel bpmnModel) { for (DataSpec dataSpec : activityIoSpecification.getDataInputs()) { ItemDefinition itemDefinition = itemDefinitionMap.get(dataSpec.getItemSubjectRef()); execution.setVariable(dataSpec.getId(), itemDefinition.createInstance()); } for (DataSpec dataSpec : activityIoSpecification.getDataOutputs()) { ItemDefinition itemDefinition = itemDefinitionMap.get(dataSpec.getItemSubjectRef()); execution.setVariable(dataSpec.getId(), itemDefinition.createInstance()); } }
public void initialize(DelegateExecution execution) { for (Data data : this.dataInputs) { execution.setVariable(data.getName(), data.getDefinition().createInstance()); } for (Data data : this.dataOutputs) { execution.setVariable(data.getName(), data.getDefinition().createInstance()); } }
@Override public void evaluate(DelegateExecution execution) { MessageInstance message = (MessageInstance) execution.getVariable(WebServiceActivityBehavior.CURRENT_MESSAGE); if (message.getStructureInstance() instanceof FieldBaseStructureInstance) { FieldBaseStructureInstance structure = (FieldBaseStructureInstance) message.getStructureInstance(); execution.setVariable(this.getTarget(), structure.getFieldValue(this.getSource())); } } }
@Override public void notify(DelegateExecution execution) { validateParameters(); ScriptingEngines scriptingEngines = Context.getProcessEngineConfiguration().getScriptingEngines(); Object result = scriptingEngines.evaluate(script.getExpressionText(), language.getExpressionText(), execution); if (resultVariable != null) { execution.setVariable(resultVariable.getExpressionText(), result); } }
public void completing(DelegateExecution execution, DelegateExecution subProcessInstance) throws Exception { // only data. no control flow available on this execution. ExpressionManager expressionManager = Context.getProcessEngineConfiguration().getExpressionManager(); // copy process variables ExecutionEntity executionEntity = (ExecutionEntity) execution; CallActivity callActivity = (CallActivity) executionEntity.getCurrentFlowElement(); for (IOParameter ioParameter : callActivity.getOutParameters()) { Object value = null; if (StringUtils.isNotEmpty(ioParameter.getSourceExpression())) { Expression expression = expressionManager.createExpression(ioParameter.getSourceExpression().trim()); value = expression.getValue(subProcessInstance); } else { value = subProcessInstance.getVariable(ioParameter.getSource()); } execution.setVariable(ioParameter.getTarget(), value); } }
execution.setVariable(resultVariable, result);
execution.setVariable(resultVariable, value);
execution.setVariable(CURRENT_MESSAGE, message); processEngineConfig.getWsOverridenEndpointAddresses()); execution.setVariable(CURRENT_MESSAGE, receivedMessage); execution.setVariable(CURRENT_MESSAGE, null); leave(execution); } catch (Exception exc) {
@Override public void notify(DelegateTask delegateTask) { delegateTask.getExecution().setVariable("chiefId",delegateTask.getAssignee()); } }
@Override public void notify(DelegateTask delegateTask) { if(delegateTask.getTaskDefinitionKey().equals("verify")){ delegateTask.getExecution().setVariable("verifiers",delegateTask.getAssignee()); }else if(delegateTask.getTaskDefinitionKey().equals("approve")){ delegateTask.getExecution().setVariable("approvers",delegateTask.getAssignee()); delegateTask.getExecution().setVariable("taskState",1); } } }
public class ExampleExecutionListenerOne implements ExecutionListener { public void notify(DelegateExecution execution) throws Exception { execution.setVariable("Approve", true); } }
/** * Install the collector on the setVariable class */ public void install(DelegateExecution execution) { doAnswer(this).when(execution).setVariable(Matchers.<String>any(), any()); }
@Override public void execute(DelegateExecution execution) throws Exception { Object result = invokeOpenMethod(execution); String resultValue = (String) resultVariable.getValue(execution); execution.setVariable(resultValue, result); }
protected void initializeIoSpecification(IOSpecification activityIoSpecification, DelegateExecution execution, BpmnModel bpmnModel) { for (DataSpec dataSpec : activityIoSpecification.getDataInputs()) { ItemDefinition itemDefinition = itemDefinitionMap.get(dataSpec.getItemSubjectRef()); execution.setVariable(dataSpec.getId(), itemDefinition.createInstance()); } for (DataSpec dataSpec : activityIoSpecification.getDataOutputs()) { ItemDefinition itemDefinition = itemDefinitionMap.get(dataSpec.getItemSubjectRef()); execution.setVariable(dataSpec.getId(), itemDefinition.createInstance()); } }
public void initialize(DelegateExecution execution) { for (Data data : this.dataInputs) { execution.setVariable(data.getName(), data.getDefinition().createInstance()); } for (Data data : this.dataOutputs) { execution.setVariable(data.getName(), data.getDefinition().createInstance()); } }
@Override public void evaluate(DelegateExecution execution) { MessageInstance message = (MessageInstance) execution.getVariable(WebServiceActivityBehavior.CURRENT_MESSAGE); if (message.getStructureInstance() instanceof FieldBaseStructureInstance) { FieldBaseStructureInstance structure = (FieldBaseStructureInstance) message.getStructureInstance(); execution.setVariable(this.getTarget(), structure.getFieldValue(this.getSource())); } } }
@Override public void notify(DelegateExecution execution) { validateParameters(); ScriptingEngines scriptingEngines = Context.getProcessEngineConfiguration().getScriptingEngines(); Object result = scriptingEngines.evaluate(script.getExpressionText(), language.getExpressionText(), execution); if (resultVariable != null) { execution.setVariable(resultVariable.getExpressionText(), result); } }