use of org.camunda.bpm.engine.variable.value.TypedValue in project camunda-bpm-platform by camunda.
the class DefaultDmnHistoryEventProducer method createHistoricDecisionInputInstances.
protected List<HistoricDecisionInputInstance> createHistoricDecisionInputInstances(DmnDecisionTableEvaluationEvent evaluationEvent) {
List<HistoricDecisionInputInstance> inputInstances = new ArrayList<HistoricDecisionInputInstance>();
for (DmnEvaluatedInput inputClause : evaluationEvent.getInputs()) {
HistoricDecisionInputInstanceEntity inputInstance = new HistoricDecisionInputInstanceEntity();
inputInstance.setClauseId(inputClause.getId());
inputInstance.setClauseName(inputClause.getName());
TypedValue typedValue = Variables.untypedValue(inputClause.getValue());
inputInstance.setValue(typedValue);
inputInstances.add(inputInstance);
}
return inputInstances;
}
use of org.camunda.bpm.engine.variable.value.TypedValue in project camunda-bpm-platform by camunda.
the class CaseCallActivityTest method testCallCaseOutputAllVariablesTypedToProcess.
@Deployment(resources = { "org/camunda/bpm/engine/test/bpmn/callactivity/CaseCallActivityTest.testOutputAll.bpmn20.xml", "org/camunda/bpm/engine/test/api/cmmn/oneTaskCaseWithManualActivation.cmmn" })
public void testCallCaseOutputAllVariablesTypedToProcess() {
startProcessInstanceByKey("process");
CaseInstance caseInstance = queryOneTaskCaseInstance();
String variableName = "foo";
String variableName2 = "null";
TypedValue variableValue = Variables.stringValue("bar");
TypedValue variableValue2 = Variables.integerValue(null);
caseService.withCaseExecution(caseInstance.getId()).setVariable(variableName, variableValue).setVariable(variableName2, variableValue2).execute();
complete(caseInstance.getId());
Task task = taskService.createTaskQuery().singleResult();
TypedValue value = runtimeService.getVariableTyped(task.getProcessInstanceId(), variableName);
assertThat(value, is(variableValue));
value = runtimeService.getVariableTyped(task.getProcessInstanceId(), variableName2);
assertThat(value, is(variableValue2));
}
use of org.camunda.bpm.engine.variable.value.TypedValue in project camunda-bpm-platform by camunda.
the class PrimitiveTypeValueSerializationTest method shouldGetTypedNullVariable.
@Test
public void shouldGetTypedNullVariable() {
ProcessInstance instance = runtimeService.startProcessInstanceByKey(PROCESS_DEFINITION_KEY);
runtimeService.setVariable(instance.getId(), VARIABLE_NAME, nullValue);
assertEquals(null, runtimeService.getVariable(instance.getId(), VARIABLE_NAME));
TypedValue typedVariableValue = runtimeService.getVariableTyped(instance.getId(), VARIABLE_NAME);
assertEquals(nullValue.getType(), typedVariableValue.getType());
assertEquals(null, typedVariableValue.getValue());
}
use of org.camunda.bpm.engine.variable.value.TypedValue in project camunda-bpm-platform by camunda.
the class CmmnExecution method hasVariableWithSameNameInParent.
protected boolean hasVariableWithSameNameInParent(CmmnExecution execution, String variableName) {
while (execution != null) {
if (execution.getId().equals(getId())) {
return false;
}
TypedValue variableTypedValue = execution.getVariableLocalTyped(variableName);
if (variableTypedValue != null) {
return true;
}
execution = execution.getParent();
}
return false;
}
use of org.camunda.bpm.engine.variable.value.TypedValue in project camunda-bpm-platform by camunda.
the class GetCaseExecutionVariableTypedCmd method execute.
public TypedValue execute(CommandContext commandContext) {
ensureNotNull("caseExecutionId", caseExecutionId);
ensureNotNull("variableName", variableName);
CaseExecutionEntity caseExecution = commandContext.getCaseExecutionManager().findCaseExecutionById(caseExecutionId);
ensureNotNull(CaseExecutionNotFoundException.class, "case execution " + caseExecutionId + " doesn't exist", "caseExecution", caseExecution);
for (CommandChecker checker : commandContext.getProcessEngineConfiguration().getCommandCheckers()) {
checker.checkReadCaseInstance(caseExecution);
}
TypedValue value;
if (isLocal) {
value = caseExecution.getVariableLocalTyped(variableName, deserializeValue);
} else {
value = caseExecution.getVariableTyped(variableName, deserializeValue);
}
return value;
}
Aggregations