org.camunda.bpm.engine.variable.Variables.integerValue()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(8.8k)|赞(0)|评价(0)|浏览(101)

本文整理了Java中org.camunda.bpm.engine.variable.Variables.integerValue()方法的一些代码示例,展示了Variables.integerValue()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Variables.integerValue()方法的具体详情如下:
包路径:org.camunda.bpm.engine.variable.Variables
类名称:Variables
方法名:integerValue

Variables.integerValue介绍

[英]Creates a new IntegerValue that encapsulates the given integer
[中]创建一个新的IntegerValue,该值封装给定的integer

代码示例

代码示例来源:origin: camunda/camunda-bpm-platform

/**
 * Creates a new {@link IntegerValue} that encapsulates the given <code>integer</code>
 */
public static IntegerValue integerValue(Integer integer) {
 return integerValue(integer, false);
}

代码示例来源:origin: camunda/camunda-bpm-platform

@Override
protected TypedValue aggregateValues(List<TypedValue> values) {
 return Variables.integerValue(values.size());
}

代码示例来源:origin: camunda/camunda-bpm-platform

@Override
public TypedValue transform(Object value) throws IllegalArgumentException {
 if (value instanceof Number) {
  int intValue = transformNumber((Number) value);
  return Variables.integerValue(intValue);
 } else if (value instanceof String) {
  int intValue = transformString((String) value);
  return Variables.integerValue(intValue);
 } else {
  throw new IllegalArgumentException();
 }
}

代码示例来源:origin: camunda/camunda-bpm-platform

public IntegerValue readValue(ValueFields valueFields) {
 Integer intValue = null;
 if(valueFields.getLongValue() != null) {
  intValue = Integer.valueOf(valueFields.getLongValue().intValue());
 }
 return Variables.integerValue(intValue);
}

代码示例来源:origin: camunda/camunda-bpm-platform

public IntegerValue readValue(ValueFields valueFields) {
 Integer intValue = null;
 if(valueFields.getLongValue() != null) {
  intValue = Integer.valueOf(valueFields.getLongValue().intValue());
 }
 return Variables.integerValue(intValue);
}

代码示例来源:origin: camunda/camunda-bpm-platform

@Override
 public void execute(DelegateExecution execution) throws Exception {
  execution.setVariable(VARIABLE_NAME, Variables.integerValue(1, true));
 }
}

代码示例来源:origin: camunda/camunda-bpm-platform

@Override
 public void execute(DelegateExecution execution) throws Exception {
  Boolean transient1 = (Boolean) execution.getVariable("transient1");
  Boolean transient2 = (Boolean) execution.getVariable("transient2");
  execution.setVariable(VARIABLE_NAME, Variables.integerValue(1, transient1));
  execution.setVariable(VARIABLE_NAME, Variables.integerValue(2, transient2));
 }
}

代码示例来源:origin: camunda/camunda-bpm-platform

@Override
 public void execute(DelegateExecution execution) throws Exception {
  execution.setVariable(VARIABLE_NAME, Variables.integerValue(1, true));
  execution.setVariable(VARIABLE_NAME, Variables.integerValue(OUTPUT_VALUE, true));
  execution.setVariable("transientVariableOutput", execution.getVariable(VARIABLE_NAME));
 }
}

代码示例来源:origin: camunda/camunda-bpm-platform

@Test
public void testGetSingleVariable() {
 String variableKey = "aVariableKey";
 int variableValue = 123;
 when(runtimeServiceMock.getVariableTyped(eq(MockProvider.EXAMPLE_PROCESS_INSTANCE_ID), eq(variableKey), eq(true)))
  .thenReturn(Variables.integerValue(variableValue));
 given().pathParam("id", MockProvider.EXAMPLE_PROCESS_INSTANCE_ID).pathParam("varId", variableKey)
  .then().expect().statusCode(Status.OK.getStatusCode())
  .body("value", is(123))
  .body("type", is("Integer"))
  .when().get(SINGLE_PROCESS_INSTANCE_VARIABLE_URL);
}

代码示例来源:origin: camunda/camunda-bpm-platform

@Test
public void testGetSingleLocalVariable() {
 String variableKey = "aVariableKey";
 int variableValue = 123;
 when(runtimeServiceMock.getVariableLocalTyped(eq(MockProvider.EXAMPLE_EXECUTION_ID), eq(variableKey), anyBoolean())).thenReturn(Variables.integerValue(variableValue));
 given().pathParam("id", MockProvider.EXAMPLE_EXECUTION_ID).pathParam("varId", variableKey)
  .then().expect().statusCode(Status.OK.getStatusCode())
  .body("value", is(123))
  .body("type", is("Integer"))
  .when().get(SINGLE_EXECUTION_LOCAL_VARIABLE_URL);
}

代码示例来源:origin: camunda/camunda-bpm-platform

@Test
public void testGetSingleLocalVariable() {
 String variableKey = "aVariableKey";
 int variableValue = 123;
 when(taskServiceMock.getVariableLocalTyped(eq(EXAMPLE_TASK_ID), eq(variableKey), anyBoolean()))
  .thenReturn(Variables.integerValue(variableValue));
 given().pathParam("id", EXAMPLE_TASK_ID).pathParam("varId", variableKey)
  .header("accept", MediaType.APPLICATION_JSON)
  .then().expect().statusCode(Status.OK.getStatusCode())
  .body("value", is(123))
  .body("type", is("Integer"))
  .when().get(SINGLE_TASK_SINGLE_VARIABLE_URL);
}

代码示例来源:origin: camunda/camunda-bpm-platform

@Test
public void testGetSingleVariable() {
 String variableKey = "aVariableKey";
 int variableValue = 123;
 when(taskServiceMock.getVariableTyped(eq(EXAMPLE_TASK_ID), eq(variableKey), anyBoolean()))
  .thenReturn(Variables.integerValue(variableValue));
 given().pathParam("id", EXAMPLE_TASK_ID).pathParam("varId", variableKey)
  .header("accept", MediaType.APPLICATION_JSON)
  .then().expect().statusCode(Status.OK.getStatusCode())
  .body("value", is(123))
  .body("type", is("Integer"))
  .when().get(SINGLE_TASK_SINGLE_VARIABLE_URL);
}

代码示例来源:origin: camunda/camunda-bpm-platform

@Test
public void testGetSingleVariable() {
 String variableKey = "aVariableKey";
 int variableValue = 123;
 when(caseServiceMock.getVariableTyped(MockProvider.EXAMPLE_CASE_INSTANCE_ID, variableKey, true))
  .thenReturn(Variables.integerValue(variableValue));
 given().pathParam("id", MockProvider.EXAMPLE_CASE_INSTANCE_ID).pathParam("varId", variableKey)
  .then().expect().statusCode(Status.OK.getStatusCode())
  .body("value", is(123))
  .body("type", is("Integer"))
  .when().get(SINGLE_CASE_INSTANCE_VARIABLE_URL);
 verify(caseServiceMock).getVariableTyped(MockProvider.EXAMPLE_CASE_INSTANCE_ID, variableKey, true);
}

代码示例来源:origin: camunda/camunda-bpm-platform

@Test
public void testExclusiveGateway() {
 // given
 testRule.deploy("org/camunda/bpm/engine/test/bpmn/gateway/ExclusiveGatewayTest.testDivergingExclusiveGateway.bpmn20.xml");
 // when
 runtimeService.startProcessInstanceByKey("exclusiveGwDiverging",
   Variables.createVariables().putValueTyped("input", Variables.integerValue(1, true)));
 // then
 List<VariableInstance> variables = runtimeService.createVariableInstanceQuery().list();
 assertEquals(0, variables.size());
 Task task = taskService.createTaskQuery().singleResult();
 assertEquals("theTask1", task.getTaskDefinitionKey());
}

代码示例来源:origin: camunda/camunda-bpm-platform

@Deployment(resources = { TEST_CASE, TEST_DECISION_COLLECT_COUNT })
public void testCollectCountHitPolicyNoOutput() {
 startTestCase("no output");
 assertEquals(1, results.size());
 DmnDecisionResultEntries firstOutput = results.get(0);
 assertEquals(0, firstOutput.getFirstEntry());
 assertEquals(Variables.integerValue(0), firstOutput.getFirstEntryTyped());
}

代码示例来源:origin: camunda/camunda-bpm-platform

@Deployment(resources = { TEST_CASE, TEST_DECISION_COLLECT_SUM })
public void testCollectSumHitPolicySingleEntryList() {
 startTestCase("single entry list");
 assertEquals(1, results.size());
 DmnDecisionResultEntries firstOutput = results.get(0);
 assertEquals(33, firstOutput.getFirstEntry());
 assertEquals(Variables.integerValue(33), firstOutput.getFirstEntryTyped());
}

代码示例来源:origin: camunda/camunda-bpm-platform

@Deployment(resources = { TEST_PROCESS, TEST_DECISION_COLLECT_COUNT })
public void testCollectCountHitPolicyNoOutput() {
 startTestProcess("no output");
 assertEquals(1, results.size());
 DmnDecisionResultEntries firstOutput = results.get(0);
 assertEquals(0, firstOutput.getFirstEntry());
 assertEquals(Variables.integerValue(0), firstOutput.getFirstEntryTyped());
}

代码示例来源:origin: camunda/camunda-bpm-platform

@Deployment(resources = { TEST_CASE, TEST_DECISION_COLLECT_SUM })
public void testCollectSumHitPolicySingleEntry() {
 startTestCase("single entry");
 assertEquals(1, results.size());
 DmnDecisionResultEntries firstOutput = results.get(0);
 assertEquals(12, firstOutput.getFirstEntry());
 assertEquals(Variables.integerValue(12), firstOutput.getFirstEntryTyped());
}

代码示例来源:origin: camunda/camunda-bpm-platform

@Deployment(resources = { TEST_PROCESS, TEST_DECISION_COLLECT_SUM })
public void testCollectSumHitPolicySingleEntry() {
 startTestProcess("single entry");
 assertEquals(1, results.size());
 DmnDecisionResultEntries firstOutput = results.get(0);
 assertEquals(12, firstOutput.getFirstEntry());
 assertEquals(Variables.integerValue(12), firstOutput.getFirstEntryTyped());
}

代码示例来源:origin: camunda/camunda-bpm-platform

@Deployment(resources = { TEST_PROCESS, TEST_DECISION_COLLECT_SUM })
public void testCollectSumHitPolicySingleEntryList() {
 startTestProcess("single entry list");
 assertEquals(1, results.size());
 DmnDecisionResultEntries firstOutput = results.get(0);
 assertEquals(33, firstOutput.getFirstEntry());
 assertEquals(Variables.integerValue(33), firstOutput.getFirstEntryTyped());
}

相关文章