当前位置: 首页>>代码示例>>Java>>正文


Java DelegateExecution.setVariableLocal方法代码示例

本文整理汇总了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();
}
 
开发者ID:FrVaBe,项目名称:camunda,代码行数:12,代码来源:SetVariablesTask.java

示例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());

  }
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:37,代码来源:AssertVariableInstancesDelegate.java

示例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", "");
}
 
开发者ID:FrVaBe,项目名称:camunda,代码行数:5,代码来源:GlobalExecutionListener.java

示例4: execute

import org.camunda.bpm.engine.delegate.DelegateExecution; //导入方法依赖的package包/类
public void execute(DelegateExecution execution) throws Exception {
  execution.setVariableLocal("test", "test2");
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:4,代码来源:SetLocalVariableTask.java

示例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);
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:7,代码来源:TerminateEndEventTest.java

示例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);
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:7,代码来源:SetVariableOnConcurrentExecutionDelegate.java

示例7: notify

import org.camunda.bpm.engine.delegate.DelegateExecution; //导入方法依赖的package包/类
@Override
public void notify(DelegateExecution execution) throws Exception {
  execution.setVariableLocal(variableName, variableValue);
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:5,代码来源:SetLocalVariableListener.java

示例8: execute

import org.camunda.bpm.engine.delegate.DelegateExecution; //导入方法依赖的package包/类
public void execute(DelegateExecution execution) throws Exception {
  execution.setVariableLocal("testVar", "testValue");
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:4,代码来源:SetVariableLocalService.java

示例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);
    }

  }
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:15,代码来源:ChangeVariablePropertyDelegate.java

示例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);
  }
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:10,代码来源:SetVariablesDelegate.java


注:本文中的org.camunda.bpm.engine.delegate.DelegateExecution.setVariableLocal方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。