use of org.kie.api.runtime.manager.audit.VariableInstanceLog in project jbpm by kiegroup.
the class StartEventTest method testSignalOutputType.
@Test
@BZ("1090375")
public void testSignalOutputType() throws Exception {
KieSession ksession = createKSession(SIGNAL_OUTPUT_TYPE);
SignalObjectReport report = new SignalObjectReport("Type of signal object report");
ksession.signalEvent("SignalObjectReport", report);
List<? extends VariableInstanceLog> vars = getLogService().findVariableInstancesByName("report", false);
VariableInstanceLog lastvar = vars.get(vars.size() - 1);
Assertions.assertThat(lastvar.getValue()).isEqualTo(report.toString());
}
use of org.kie.api.runtime.manager.audit.VariableInstanceLog in project jbpm by kiegroup.
the class AsyncThreadContinuationTest method testCorrectProcessStateAfterException.
@Test
public void testCorrectProcessStateAfterException() {
KieSession ksession = createKSession(BPMN_ATC);
Map<String, Object> params = new HashMap<String, Object>();
params.put("message", "Ivo");
ProcessInstance pi = ksession.startProcess(PROCESS_ATC, params);
List<? extends VariableInstanceLog> vars = getLogService().findVariableInstances(pi.getId(), "message");
List<String> varValues = new ArrayList<String>();
for (VariableInstanceLog v : vars) {
varValues.add(v.getValue());
}
Assertions.assertThat(varValues).contains("Hello Ivo").doesNotContain("Hello Ivo asynchronously");
}
use of org.kie.api.runtime.manager.audit.VariableInstanceLog in project jbpm by kiegroup.
the class AsyncThreadContinuationTest method testRepeatFailingSyncTask.
@Test(timeout = 10000)
public void testRepeatFailingSyncTask() {
KieSession ksession = createKSession(BPMN_ATC);
Map<String, Object> params = new HashMap<String, Object>();
params.put("message", "Ivo");
ProcessInstance pi = ksession.startProcess(PROCESS_ATC, params);
synchronized (LOCK_ATC) {
try {
LOCK_ATC.wait();
} catch (InterruptedException e) {
}
}
ksession.getProcessInstance(pi.getId());
List<? extends VariableInstanceLog> vars = getLogService().findVariableInstances(pi.getId(), "message");
List<String> varValues = new ArrayList<String>();
for (VariableInstanceLog v : vars) {
varValues.add(v.getValue());
}
Assertions.assertThat(varValues).contains("Hello Ivo asynchronously");
}
use of org.kie.api.runtime.manager.audit.VariableInstanceLog in project jbpm by kiegroup.
the class AsyncThreadIsolationTest method testCorrectProcessStateAfterException.
@Test(timeout = 10000)
public void testCorrectProcessStateAfterException() {
KieSession ksession = createKSession(BPMN_ATI);
Map<String, Object> params = new HashMap<String, Object>();
params.put("message", "Ivo");
ProcessInstance pi = ksession.startProcess(PROCESS_ATI, params);
synchronized (LOCK) {
try {
LOCK.wait();
} catch (InterruptedException e) {
}
}
List<? extends VariableInstanceLog> vars = getLogService().findVariableInstances(pi.getId(), "message");
List<String> varValues = new ArrayList<String>();
for (VariableInstanceLog v : vars) {
varValues.add(v.getValue());
}
Assertions.assertThat(varValues).contains("Hello Ivo asynchronously");
pi = ksession.getProcessInstance(pi.getId());
Assertions.assertThat(pi).isNotNull();
Assertions.assertThat(pi.getState()).isEqualTo(ProcessInstance.STATE_ACTIVE);
}
Aggregations