use of org.kie.kogito.internal.process.runtime.KogitoProcessInstance.STATE_ACTIVE in project kogito-runtimes by kiegroup.
the class VariableTagsTest method testRequiredVariableFiltering.
@Test
public void testRequiredVariableFiltering() {
List<BpmnProcess> processes = BpmnProcess.from(new ClassPathResource("variable-tags/approval-with-custom-variable-tags.bpmn2"));
BpmnProcess process = processes.get(0);
Map<String, Object> params = new HashMap<>();
params.put("approver", "john");
org.kie.kogito.process.ProcessInstance<BpmnVariables> instance = process.createInstance(BpmnVariables.create(params));
instance.start();
assertEquals(STATE_ACTIVE, instance.status());
assertThat(instance.variables().toMap()).hasSize(1);
assertThat(instance.variables().toMap(BpmnVariables.OUTPUTS_ONLY)).hasSize(0);
assertThat(instance.variables().toMap(BpmnVariables.INPUTS_ONLY)).hasSize(0);
assertThat(instance.variables().toMap(BpmnVariables.INTERNAL_ONLY)).hasSize(0);
assertThat(instance.variables().toMap(v -> v.hasTag("onlyAdmin"))).hasSize(1).containsEntry("approver", "john");
instance.abort();
assertEquals(STATE_ABORTED, instance.status());
}
Aggregations