use of org.kie.internal.process.CorrelationKey in project jbpm by kiegroup.
the class CorrelationKeyTest method testMultiValuedKey.
@Test
public void testMultiValuedKey() {
CorrelationKey key = keyFactory.newCorrelationKey(COMPOSED_KEY);
ProcessInstance processInstance = ksession.startProcess(PROCESS, key, null);
assertProcessInstanceActive(processInstance.getId());
CorrelationKey keyCopy = keyFactory.newCorrelationKey(COMPOSED_KEY);
ProcessInstance processInstanceCopy = ksession.getProcessInstance(keyCopy);
Assertions.assertThat(processInstanceCopy.getId()).isEqualTo(processInstance.getId());
}
use of org.kie.internal.process.CorrelationKey in project jbpm by kiegroup.
the class CorrelationKeyTest method testGetNotExistingSimpleKey.
@Test
public void testGetNotExistingSimpleKey() {
CorrelationKey key = keyFactory.newCorrelationKey(SIMPLE_KEY);
ProcessInstance processInstance = ksession.getProcessInstance(key);
Assertions.assertThat(processInstance).isNull();
}
use of org.kie.internal.process.CorrelationKey in project jbpm by kiegroup.
the class CorrelationKeyTest method testMultiValuedKeyUniqueButInclusive.
@Test
public void testMultiValuedKeyUniqueButInclusive() {
// JBPM-5897
CorrelationKey key1 = keyFactory.newCorrelationKey(Arrays.asList("ABC", "DEF", "DEF"));
ProcessInstance processInstance = ksession.startProcess(PROCESS, key1, null);
assertProcessInstanceActive(processInstance.getId());
CorrelationKey key2 = keyFactory.newCorrelationKey(Arrays.asList("ABC", "DEF", "GHI"));
ProcessInstance processInstance2 = ksession.startProcess(PROCESS, key2, null);
assertProcessInstanceActive(processInstance2.getId());
}
use of org.kie.internal.process.CorrelationKey in project jbpm by kiegroup.
the class CorrelationKeyTest method testStartProcessParametersPassing.
@Test
public void testStartProcessParametersPassing() {
CorrelationKey key = keyFactory.newCorrelationKey(SIMPLE_KEY);
Map<String, Object> parameters = new HashMap<String, Object>();
parameters.put(VARIABLE_ID, VARIABLE_VALUE);
ProcessInstance processInstance = ksession.startProcess(PROCESS, key, parameters);
assertProcessInstanceActive(processInstance.getId());
List<? extends VariableInstanceLog> variables = getLogService().findVariableInstances(processInstance.getId());
Assertions.assertThat(variables).isNotEmpty();
Assertions.assertThat(variables.get(0).getVariableId()).isEqualTo(VARIABLE_ID);
Assertions.assertThat(variables.get(0).getValue()).isEqualTo(VARIABLE_VALUE);
}
use of org.kie.internal.process.CorrelationKey in project jbpm by kiegroup.
the class CorrelationKeyTest method testGetNotExistingMultiValuedKey.
@Test
public void testGetNotExistingMultiValuedKey() {
CorrelationKey key = keyFactory.newCorrelationKey(COMPOSED_KEY);
ProcessInstance processInstance = ksession.getProcessInstance(key);
Assertions.assertThat(processInstance).isNull();
}
Aggregations