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

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

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

Variables.untypedValue介绍

[英]Creates an untyped value, i.e. TypedValue#getType() returns null for the returned instance.
[中]为返回的实例创建一个非类型化的值,即TypedValue#getType()返回null

代码示例

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

public QueryVariableValue(String name, Object value, QueryOperator operator, boolean local) {
 this.name = name;
 this.value = Variables.untypedValue(value);
 this.operator = operator;
 this.local = local;
}

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

public QueryVariableValue(String name, Object value, QueryOperator operator, boolean local) {
 this.name = name;
 this.value = Variables.untypedValue(value);
 this.operator = operator;
 this.local = local;
}

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

@Override
public TypedValue transform(Object value) throws IllegalArgumentException {
 return Variables.untypedValue(value);
}

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

@Override
public TypedValue transform(Object value) throws IllegalArgumentException {
 return Variables.untypedValue(value);
}

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

/**
 * Creates an untyped value, i.e. {@link TypedValue#getType()} returns <code>null</code>
 * for the returned instance.
 */
public static TypedValue untypedValue(Object value) {
 if (value instanceof TypedValue) {
  return untypedValue(value, ((TypedValue) value).isTransient());
 }
 else return untypedValue(value, false);
}

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

public Object put(String key, Object value) {
 TypedValue typedValue = Variables.untypedValue(value);
 TypedValue prevValue = variables.put(key, typedValue);
 if(prevValue != null) {
  return prevValue.getValue();
 }
 else {
  return null;
 }
}

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

public void setVariableLocal(String variableName, Object value) {
 TypedValue typedValue = Variables.untypedValue(value);
 setVariableLocal(variableName, typedValue, getSourceActivityVariableScope());
}

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

public void setVariable(String variableName, Object value) {
 TypedValue typedValue = Variables.untypedValue(value);
 setVariable(variableName, typedValue, getSourceActivityVariableScope());
}

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

public void setVariable(String variableName, Object value) {
 TypedValue typedValue = Variables.untypedValue(value);
 setVariable(variableName, typedValue, getSourceActivityVariableScope());
}

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

public void setVariableLocal(String variableName, Object value) {
 TypedValue typedValue = Variables.untypedValue(value);
 setVariableLocal(variableName, typedValue, getSourceActivityVariableScope());
}

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

public void initializeVariableStore(Map<String, Object> variables) {
 for (String variableName : variables.keySet()) {
  TypedValue value = Variables.untypedValue(variables.get(variableName));
  CoreVariableInstance variableValue = getVariableInstanceFactory().build(variableName, value, false);
  getVariableStore().addVariable(variableValue);
 }
}

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

public void initializeVariableStore(Map<String, Object> variables) {
 for (String variableName : variables.keySet()) {
  TypedValue value = Variables.untypedValue(variables.get(variableName));
  CoreVariableInstance variableValue = getVariableInstanceFactory().build(variableName, value, false);
  getVariableStore().addVariable(variableValue);
 }
}

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

@Test(expected = UnsupportedOperationException.class)
public void testThrowsExceptionWhenConvertingUnknownUntypedValueToTypedValue() {
 serializer.convertToTypedValue((UntypedValueImpl) Variables.untypedValue(new Object()));
}

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

/**
 * Sets a variable in the local scope. In contrast to
 * {@link #setVariableLocal(String, Object)}, the variable is transient that
 * means it will not be stored in the data base. For example, a transient
 * variable can be used for a result variable that is only available for
 * output mapping.
 */
public void setVariableLocalTransient(String variableName, Object value) {
 TypedValue typedValue = Variables.untypedValue(value, true);
 checkJavaSerialization(variableName, typedValue);
 CoreVariableInstance coreVariableInstance = getVariableInstanceFactory().build(variableName, typedValue, true);
 getVariableStore().addVariable(coreVariableInstance);
}

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

/**
 * Sets a variable in the local scope. In contrast to
 * {@link #setVariableLocal(String, Object)}, the variable is transient that
 * means it will not be stored in the data base. For example, a transient
 * variable can be used for a result variable that is only available for
 * output mapping.
 */
public void setVariableLocalTransient(String variableName, Object value) {
 TypedValue typedValue = Variables.untypedValue(value, true);
 checkJavaSerialization(variableName, typedValue);
 CoreVariableInstance coreVariableInstance = getVariableInstanceFactory().build(variableName, typedValue, true);
 getVariableStore().addVariable(coreVariableInstance);
}

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

protected List<HistoricDecisionInputInstance> createHistoricDecisionInputInstances(DmnDecisionTableEvaluationEvent evaluationEvent, String rootProcessInstanceId, Date removalTime) {
 List<HistoricDecisionInputInstance> inputInstances = new ArrayList<HistoricDecisionInputInstance>();
 for(DmnEvaluatedInput inputClause : evaluationEvent.getInputs()) {
  HistoricDecisionInputInstanceEntity inputInstance = new HistoricDecisionInputInstanceEntity(rootProcessInstanceId, removalTime);
  inputInstance.setClauseId(inputClause.getId());
  inputInstance.setClauseName(inputClause.getName());
  inputInstance.setCreateTime(ClockUtil.getCurrentTime());
  TypedValue typedValue = Variables.untypedValue(inputClause.getValue());
  inputInstance.setValue(typedValue);
  inputInstances.add(inputInstance);
 }
 return inputInstances;
}

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

protected List<HistoricDecisionInputInstance> createHistoricDecisionInputInstances(DmnDecisionTableEvaluationEvent evaluationEvent, String rootProcessInstanceId, Date removalTime) {
 List<HistoricDecisionInputInstance> inputInstances = new ArrayList<HistoricDecisionInputInstance>();
 for(DmnEvaluatedInput inputClause : evaluationEvent.getInputs()) {
  HistoricDecisionInputInstanceEntity inputInstance = new HistoricDecisionInputInstanceEntity(rootProcessInstanceId, removalTime);
  inputInstance.setClauseId(inputClause.getId());
  inputInstance.setClauseName(inputClause.getName());
  inputInstance.setCreateTime(ClockUtil.getCurrentTime());
  TypedValue typedValue = Variables.untypedValue(inputClause.getValue());
  inputInstance.setValue(typedValue);
  inputInstances.add(inputInstance);
 }
 return inputInstances;
}

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

final TypedValue expressionValue = Variables.untypedValue(defaultValueExpression.getValue(variableScope));
if (type != null) {
 modelValue = type.convertToModelValue(Variables.untypedValue(expressionValue));

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

.putValue("h", Variables.shortValue((short) 10, true))
.putValue("i", Variables.objectValue(new Integer(100), true).create())
.putValue("j", Variables.untypedValue(null, true))
.putValue("k", Variables.untypedValue(Variables.booleanValue(true), true))
.putValue("l", Variables.fileValue(new File(this.getClass().getClassLoader()
  .getResource("org/camunda/bpm/engine/test/standalone/variables/simpleFile.txt").toURI()), true)));

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

@Test
public void createVariablesUsingVariableMap() {
 // given
 BpmnModelInstance simpleInstanceWithListener = Bpmn.createExecutableProcess("Process")
   .startEvent()
    .camundaExecutionListenerClass(ExecutionListener.EVENTNAME_END, ReadTransientVariableExecutionListener.class)
   .userTask()
   .endEvent()
   .done();
 testRule.deploy(simpleInstanceWithListener);
 // when
 VariableMap variables = Variables.createVariables();
 variables.put(VARIABLE_NAME, Variables.untypedValue(true, true));
 runtimeService.startProcessInstanceByKey("Process",
   variables
   );
 // then
 List<VariableInstance> variableInstances = runtimeService.createVariableInstanceQuery().list();
 List<HistoricVariableInstance> historicVariableInstances = historyService.createHistoricVariableInstanceQuery().list();
 assertEquals(0, variableInstances.size());
 assertEquals(0, historicVariableInstances.size());
}

相关文章