ProcessContext extends AbstractProcessContext { public CaseAssignment getCaseAssignment() { Collection<? extends Object> objects = getKieRuntime().getObjects(new ClassObjectFilter(CaseAssignment.class)); if (objects.size() == 0) { return null; } return (CaseAssignment) objects.iterator().next(); } ProcessContext(KieRuntime kruntime); CaseData getCaseData(); CaseAssignment getCaseAssignment();  }
@Test public void testProcessContextGetAssignment() { KieBase kbase = KnowledgeBaseFactory.newKnowledgeBase(); KieSession ksession = kbase.newKieSession(); assertNotNull(ksession); CaseInformation caseInfo = new CaseInformation(); caseInfo.assign("owner", new OrganizationalEntity() { @Override public String getId() { return "testUser"; } @Override public void writeExternal(ObjectOutput out) throws IOException { } @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { } }); ksession.insert(caseInfo); ProcessContext processContext = new ProcessContext(ksession); CaseAssignment caseAssignment = processContext.getCaseAssignment(); assertNotNull(caseAssignment); Collection<OrganizationalEntity> forRole = caseAssignment.getAssignments("owner"); assertNotNull(forRole); assertEquals(1, forRole.size()); }