use of org.kie.api.runtime.process.CaseData in project drools by kiegroup.
the class ProcessContextTest method testProcessContextGetData.
@Test
public void testProcessContextGetData() {
KieBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
KieSession ksession = kbase.newKieSession();
assertNotNull(ksession);
CaseInformation caseInfo = new CaseInformation();
caseInfo.add("test", "value");
ksession.insert(caseInfo);
ProcessContext processContext = new ProcessContext(ksession);
CaseData caseData = processContext.getCaseData();
assertNotNull(caseData);
Map<String, Object> allData = caseData.getData();
assertNotNull(allData);
assertEquals(1, allData.size());
assertEquals("value", caseData.getData("test"));
}
use of org.kie.api.runtime.process.CaseData in project drools by kiegroup.
the class ProcessContextTest method testProcessContextGetDataAndAssignmentWithoutInsert.
@Test
public void testProcessContextGetDataAndAssignmentWithoutInsert() {
KieBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
KieSession ksession = kbase.newKieSession();
assertNotNull(ksession);
ProcessContext processContext = new ProcessContext(ksession);
CaseData caseData = processContext.getCaseData();
assertNull(caseData);
CaseAssignment caseAssignment = processContext.getCaseAssignment();
assertNull(caseAssignment);
}
Aggregations