本文整理汇总了Java中org.camunda.bpm.engine.delegate.DelegateExecution.setVariableLocal方法的典型用法代码示例。如果您正苦于以下问题:Java DelegateExecution.setVariableLocal方法的具体用法?Java DelegateExecution.setVariableLocal怎么用?Java DelegateExecution.setVariableLocal使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.camunda.bpm.engine.delegate.DelegateExecution
的用法示例。
在下文中一共展示了DelegateExecution.setVariableLocal方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: execute
import org.camunda.bpm.engine.delegate.DelegateExecution; //导入方法依赖的package包/类
@Override
public void execute(DelegateExecution execution) throws Exception {
System.out.println();
System.out.println("Entering '" + execution.getCurrentActivityName()
+ "' ... (variableScopeKey=" + execution.getVariableScopeKey() + ")");
System.out.println(" executing 'execution.setVariable(\"myGlobal\", \"4711\") ...' ");
execution.setVariable("myGlobal", "4711");
System.out.println(" executing 'execution.setVariableLocal(\"myLocal\", \"4712\") ...'");
execution.setVariableLocal("myLocal", "4712");
System.out.println();
}
示例2: execute
import org.camunda.bpm.engine.delegate.DelegateExecution; //导入方法依赖的package包/类
public void execute(DelegateExecution execution) throws Exception {
// validate integer variable
Integer expectedIntValue = 1234;
assertEquals(expectedIntValue, execution.getVariable("anIntegerVariable"));
assertEquals(expectedIntValue, execution.getVariableTyped("anIntegerVariable").getValue());
assertEquals(ValueType.INTEGER, execution.getVariableTyped("anIntegerVariable").getType());
assertNull(execution.getVariableLocal("anIntegerVariable"));
assertNull(execution.getVariableLocalTyped("anIntegerVariable"));
// set an additional local variable
execution.setVariableLocal("aStringVariable", "aStringValue");
String expectedStringValue = "aStringValue";
assertEquals(expectedStringValue, execution.getVariable("aStringVariable"));
assertEquals(expectedStringValue, execution.getVariableTyped("aStringVariable").getValue());
assertEquals(ValueType.STRING, execution.getVariableTyped("aStringVariable").getType());
assertEquals(expectedStringValue, execution.getVariableLocal("aStringVariable"));
assertEquals(expectedStringValue, execution.getVariableLocalTyped("aStringVariable").getValue());
assertEquals(ValueType.STRING, execution.getVariableLocalTyped("aStringVariable").getType());
SimpleSerializableBean objectValue = (SimpleSerializableBean) execution.getVariable("anObjectValue");
assertNotNull(objectValue);
assertEquals(10, objectValue.getIntProperty());
ObjectValue variableTyped = execution.getVariableTyped("anObjectValue");
assertEquals(10, variableTyped.getValue(SimpleSerializableBean.class).getIntProperty());
assertEquals(Variables.SerializationDataFormats.JAVA.getName(), variableTyped.getSerializationDataFormat());
objectValue = (SimpleSerializableBean) execution.getVariable("anUntypedObjectValue");
assertNotNull(objectValue);
assertEquals(30, objectValue.getIntProperty());
variableTyped = execution.getVariableTyped("anUntypedObjectValue");
assertEquals(30, variableTyped.getValue(SimpleSerializableBean.class).getIntProperty());
assertEquals(Context.getProcessEngineConfiguration().getDefaultSerializationFormat(), variableTyped.getSerializationDataFormat());
}
示例3: addVariables
import org.camunda.bpm.engine.delegate.DelegateExecution; //导入方法依赖的package包/类
private void addVariables(final DelegateExecution execution) {
execution.setVariable(execution.getCurrentActivityName(), "");
execution.setVariableLocal(execution.getCurrentActivityName() + "Local", "");
}
示例4: execute
import org.camunda.bpm.engine.delegate.DelegateExecution; //导入方法依赖的package包/类
public void execute(DelegateExecution execution) throws Exception {
execution.setVariableLocal("test", "test2");
}
示例5: execute
import org.camunda.bpm.engine.delegate.DelegateExecution; //导入方法依赖的package包/类
public void execute(DelegateExecution execution) throws Exception {
serviceTaskInvokedCount++;
// leave only 3 out of n subprocesses
execution.setVariableLocal("terminate", serviceTaskInvokedCount > 3);
}
示例6: execute
import org.camunda.bpm.engine.delegate.DelegateExecution; //导入方法依赖的package包/类
@Override
public void execute(DelegateExecution execution) throws Exception {
Task task = execution.getProcessEngineServices().getTaskService().createTaskQuery().taskName(TASK_WITH_CONDITION).singleResult();
((TaskEntity) task).getExecution().setVariableLocal(VARIABLE_NAME, 1);
execution.setVariableLocal(VARIABLE_NAME+1, 1);
}
示例7: notify
import org.camunda.bpm.engine.delegate.DelegateExecution; //导入方法依赖的package包/类
@Override
public void notify(DelegateExecution execution) throws Exception {
execution.setVariableLocal(variableName, variableValue);
}
示例8: execute
import org.camunda.bpm.engine.delegate.DelegateExecution; //导入方法依赖的package包/类
public void execute(DelegateExecution execution) throws Exception {
execution.setVariableLocal("testVar", "testValue");
}
示例9: execute
import org.camunda.bpm.engine.delegate.DelegateExecution; //导入方法依赖的package包/类
public void execute(DelegateExecution execution) throws Exception {
execution.setVariableLocal("var", new SimpleSerializableBean());
SimpleSerializableBean variable = (SimpleSerializableBean) execution.getVariable("var");
variable.setIntProperty(variable.getIntProperty() + 1);
boolean shouldExplicitlyUpdateVariable = (Boolean) execution.getVariable("shouldExplicitlyUpdateVariable");
if (shouldExplicitlyUpdateVariable) {
execution.setVariableLocal("var", variable);
}
}
示例10: execute
import org.camunda.bpm.engine.delegate.DelegateExecution; //导入方法依赖的package包/类
public void execute(DelegateExecution execution) throws Exception {
String variableName = (String) variable.getValue(execution);
String value = values.iterator().next();
execution.setVariableLocal(variableName, value);
values.remove(value);
}