use of org.camunda.bpm.engine.variable.value.TypedValue in project camunda-bpm-platform by camunda.
the class TaskAuthorizationTest method testProcessTaskGetVariableLocalTypedWithReadPermissionOnTask.
public void testProcessTaskGetVariableLocalTypedWithReadPermissionOnTask() {
// given
startProcessInstanceByKey(PROCESS_KEY);
String taskId = selectSingleTask().getId();
createGrantAuthorization(TASK, taskId, userId, READ);
disableAuthorization();
taskService.setVariablesLocal(taskId, getVariables());
enableAuthorization();
// when
TypedValue typedValue = taskService.getVariableLocalTyped(taskId, VARIABLE_NAME);
// then
assertNotNull(typedValue);
assertEquals(VARIABLE_VALUE, typedValue.getValue());
}
use of org.camunda.bpm.engine.variable.value.TypedValue in project camunda-bpm-platform by camunda.
the class TaskAuthorizationTest method testStandaloneTaskGetVariableLocalTypedWithReadPermissionOnTask.
public void testStandaloneTaskGetVariableLocalTypedWithReadPermissionOnTask() {
// given
String taskId = "myTask";
createTask(taskId);
createGrantAuthorization(TASK, taskId, userId, READ);
disableAuthorization();
taskService.setVariables(taskId, getVariables());
enableAuthorization();
// when
TypedValue typedValue = taskService.getVariableLocalTyped(taskId, VARIABLE_NAME);
// then
assertNotNull(typedValue);
assertEquals(VARIABLE_VALUE, typedValue.getValue());
deleteTask(taskId, true);
}
use of org.camunda.bpm.engine.variable.value.TypedValue in project camunda-bpm-platform by camunda.
the class DmnBusinessRuleTaskResultMappingTest method testSingleEntryEmptyResult.
@Deployment(resources = { SINGLE_ENTRY_BPMN, TEST_DECISION })
public void testSingleEntryEmptyResult() {
ProcessInstance processInstance = startTestProcess("empty result");
Object result = runtimeService.getVariable(processInstance.getId(), "result");
assertNull(result);
TypedValue resultTyped = runtimeService.getVariableTyped(processInstance.getId(), "result");
assertEquals(Variables.untypedNullValue(), resultTyped);
}
use of org.camunda.bpm.engine.variable.value.TypedValue in project camunda-engine-dmn by camunda.
the class DmnDataTypeTransformerTest method doubleType.
@Test
public void doubleType() {
DmnDataTypeTransformer typeTransformer = registry.getTransformer("double");
assertThat(typeTransformer.transform(4.2), is((TypedValue) Variables.doubleValue(4.2)));
assertThat(typeTransformer.transform("4.2"), is((TypedValue) Variables.doubleValue(4.2)));
assertThat(typeTransformer.transform(4), is((TypedValue) Variables.doubleValue(4.0)));
assertThat(typeTransformer.transform(4L), is((TypedValue) Variables.doubleValue(4.0)));
assertThat(typeTransformer.transform(Double.MIN_VALUE), is((TypedValue) Variables.doubleValue(Double.MIN_VALUE)));
assertThat(typeTransformer.transform(Double.MAX_VALUE), is((TypedValue) Variables.doubleValue(Double.MAX_VALUE)));
assertThat(typeTransformer.transform(-Double.MAX_VALUE), is((TypedValue) Variables.doubleValue(-Double.MAX_VALUE)));
assertThat(typeTransformer.transform(Long.MAX_VALUE), is((TypedValue) Variables.doubleValue((double) Long.MAX_VALUE)));
}
use of org.camunda.bpm.engine.variable.value.TypedValue in project camunda-engine-dmn by camunda.
the class DmnDecisionResultTest method testSingleEntryTypedValue.
@Test
@DecisionResource(resource = RESULT_TEST_WITH_TYPES_DMN)
public void testSingleEntryTypedValue() {
DmnDecisionResult decisionResult = evaluateWithMatchingRules(SINGLE_OUTPUT_VALUE);
TypedValue typedValue = decisionResult.getSingleEntryTyped();
assertThat(typedValue).isEqualTo(Variables.stringValue("singleValue"));
}
Aggregations