protected String getStringFromField(Expression expression, DelegateExecution execution) { if (expression != null) { Object value = expression.getValue(execution); if (value != null) { return value.toString(); } } return null; }
public void notify(DelegateCaseVariableInstance variableInstance) throws Exception { DelegateCaseVariableInstanceImpl variableInstanceImpl = (DelegateCaseVariableInstanceImpl) variableInstance; // Return value of expression is ignored expression.getValue(variableInstanceImpl.getScopeExecution()); }
protected Object instantiateDelegateClass(ActivityExecution execution) { Object delegate = null; if (expression != null) { delegate = expression.getValue(execution); } else if (className != null) { delegate = ClassDelegateUtil.instantiateDelegate(className, null); } return delegate; }
public void notify(DelegateCaseVariableInstance variableInstance) throws Exception { DelegateCaseVariableInstanceImpl variableInstanceImpl = (DelegateCaseVariableInstanceImpl) variableInstance; // Return value of expression is ignored expression.getValue(variableInstanceImpl.getScopeExecution()); }
protected int resolveLoopCardinality(ActivityExecution execution) { // Using Number since expr can evaluate to eg. Long (which is also the default for Juel) Object value = loopCardinalityExpression.getValue(execution); if (value instanceof Number) { return ((Number) value).intValue(); } else if (value instanceof String) { return Integer.valueOf((String) value); } else { throw LOG.expressionNotANumberException("loopCardinality", loopCardinalityExpression.getExpressionText()); } }
public void initializeFormKey() { isFormKeyInitialized = true; if(taskDefinitionKey != null) { TaskDefinition taskDefinition = getTaskDefinition(); if(taskDefinition != null) { Expression formKey = taskDefinition.getFormKey(); if(formKey != null) { this.formKey = (String) formKey.getValue(this); } } } }
@Override public Void call() throws Exception { //getValue() can have side-effects, that's why we have to call it independently from the result variable Object value = expression.getValue(execution); if (resultVariable != null) { execution.setVariable(resultVariable, value); } leave(execution); return null; } });
protected void initializeTaskName(TaskEntity task, VariableScope variableScope) { Expression nameExpression = taskDefinition.getNameExpression(); if (nameExpression != null) { String name = (String) nameExpression.getValue(variableScope); task.setName(name); } }
protected void initializeTaskAssignee(TaskEntity task, VariableScope variableScope) { Expression assigneeExpression = taskDefinition.getAssigneeExpression(); if (assigneeExpression != null) { task.setAssignee((String) assigneeExpression.getValue(variableScope)); } }
public void initializeFormKey() { isFormKeyInitialized = true; if(taskDefinitionKey != null) { TaskDefinition taskDefinition = getTaskDefinition(); if(taskDefinition != null) { Expression formKey = taskDefinition.getFormKey(); if(formKey != null) { this.formKey = (String) formKey.getValue(this); } } } }
@Override public Void call() throws Exception { //getValue() can have side-effects, that's why we have to call it independently from the result variable Object value = expression.getValue(execution); if (resultVariable != null) { execution.setVariable(resultVariable, value); } leave(execution); return null; } });
public void notify(DelegateTask delegateTask) { if (this.expression != null && this.expression.getValue(delegateTask) != null) { // get the expression variable String expression = this.expression.getValue(delegateTask).toString(); // this expression will be evaluated when completing the task delegateTask.setVariableLocal("validationRule", expression); } }
public void notify(DelegateCaseExecution caseExecution) { caseExecution.setVariable("greeting", "Hello from " + greeter.getValue(caseExecution)); caseExecution.setVariable("helloWorld", helloWorld.getValue(caseExecution)); caseExecution.setVariable("prefix", prefix.getValue(caseExecution)); caseExecution.setVariable("suffix", suffix.getValue(caseExecution)); // kind of workaround to pass through the test greeter = null; helloWorld = null; prefix = null; suffix = null; }
protected boolean completionConditionSatisfied(ActivityExecution execution) { if (completionConditionExpression != null) { Object value = completionConditionExpression.getValue(execution); if (! (value instanceof Boolean)) { throw LOG.expressionNotBooleanException("completionCondition", completionConditionExpression.getExpressionText()); } Boolean booleanValue = (Boolean) value; LOG.multiInstanceCompletionConditionState(booleanValue); return booleanValue; } return false; }
public void execute(DelegateExecution execution) { if(!setterInvoked) { throw new RuntimeException("Setter was not invoked"); } execution.setVariable("setterVar", ((String)text.getValue(execution)).toUpperCase()); }
public void notify(DelegateTask delegateTask) { delegateTask.setVariable("greeting", "Hello from " + greeter.getValue(delegateTask)); delegateTask.setVariable("helloWorld", helloWorld.getValue(delegateTask)); delegateTask.setVariable("prefix", prefix.getValue(delegateTask)); delegateTask.setVariable("suffix", suffix.getValue(delegateTask)); // kind of workaround to pass through the test greeter = null; helloWorld = null; prefix = null; suffix = null; }
protected void evaluateCollectionVariable(ActivityExecution execution, int loopCounter) { if (usesCollection() && collectionElementVariable != null) { Collection<?> collection = null; if (collectionExpression != null) { collection = (Collection<?>) collectionExpression.getValue(execution); } else if (collectionVariable != null) { collection = (Collection<?>) execution.getVariable(collectionVariable); } Object value = getElementAtIndex(loopCounter, collection); setLoopVariable(execution, collectionElementVariable, value); } }
public void execute(DelegateExecution execution) { String value1 = (String) text1.getValue(execution); execution.setVariable("var1", new StringBuffer(value1).reverse().toString()); String value2 = (String) text2.getValue(execution); execution.setVariable("var2", new StringBuffer(value2).reverse().toString()); }
public void execute(DelegateExecution execution) throws Exception { String variableName = (String) counterName.getValue(execution); Object variable = execution.getVariable(variableName); if(variable == null) { execution.setVariable(variableName, (Integer) 1); } else { execution.setVariable(variableName, ((Integer)variable)+1); } }
public void execute(ActivityExecution execution) throws Exception { String variableName = (String) counterName.getValue(execution); Object variable = execution.getVariable(variableName); if(variable == null) { execution.setVariable(variableName, (Integer) 1); } else { execution.setVariable(variableName, ((Integer)variable)+1); } }