Search in sources :

Example 16 with CaseFileInstanceImpl

use of org.jbpm.casemgmt.impl.model.instance.CaseFileInstanceImpl in project jbpm by kiegroup.

the class CommentNotificationEventListenerTest method buildCaseFile.

protected CaseFileInstance buildCaseFile(List<String> mentionedRoles) {
    CaseFileInstanceImpl caseFile = new CaseFileInstanceImpl("CASE-00001", "dummy", new HashMap<>());
    List<CaseRole> roles = mentionedRoles.stream().map(roleName -> new CaseRoleImpl(roleName)).collect(Collectors.toList());
    caseFile.setupRoles(roles);
    caseFile.assignUser("owner", "john");
    caseFile.assignUser("manager", "mary");
    return caseFile;
}
Also used : COMMENT_PARAM(org.jbpm.casemgmt.impl.event.CommentNotificationEventListener.COMMENT_PARAM) CaseRole(org.jbpm.casemgmt.api.model.CaseRole) CaseRoleImpl(org.jbpm.casemgmt.impl.model.CaseRoleImpl) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) CREATED_AT_PARAM(org.jbpm.casemgmt.impl.event.CommentNotificationEventListener.CREATED_AT_PARAM) CaseFileInstance(org.jbpm.casemgmt.api.model.instance.CaseFileInstance) Set(java.util.Set) HashMap(java.util.HashMap) Test(org.junit.Test) Collectors(java.util.stream.Collectors) ArrayList(java.util.ArrayList) OrganizationalEntity(org.kie.api.task.model.OrganizationalEntity) List(java.util.List) AUTHOR_PARAM(org.jbpm.casemgmt.impl.event.CommentNotificationEventListener.AUTHOR_PARAM) COMMENT_ID_PARAM(org.jbpm.casemgmt.impl.event.CommentNotificationEventListener.COMMENT_ID_PARAM) Map(java.util.Map) CASE_ID_PARAM(org.jbpm.casemgmt.impl.event.CommentNotificationEventListener.CASE_ID_PARAM) CaseCommentEvent(org.jbpm.casemgmt.api.event.CaseCommentEvent) CaseFileInstanceImpl(org.jbpm.casemgmt.impl.model.instance.CaseFileInstanceImpl) CommentInstanceImpl(org.jbpm.casemgmt.impl.model.instance.CommentInstanceImpl) TestNotificationPublisher(org.jbpm.casemgmt.impl.util.TestNotificationPublisher) User(org.kie.api.task.model.User) CaseRoleImpl(org.jbpm.casemgmt.impl.model.CaseRoleImpl) CaseFileInstanceImpl(org.jbpm.casemgmt.impl.model.instance.CaseFileInstanceImpl) CaseRole(org.jbpm.casemgmt.api.model.CaseRole)

Aggregations

CaseFileInstanceImpl (org.jbpm.casemgmt.impl.model.instance.CaseFileInstanceImpl)16 CaseFileInstance (org.jbpm.casemgmt.api.model.instance.CaseFileInstance)8 ArrayList (java.util.ArrayList)7 HashMap (java.util.HashMap)7 List (java.util.List)6 CaseDefinition (org.jbpm.casemgmt.api.model.CaseDefinition)5 CaseDefinitionNotFoundException (org.jbpm.casemgmt.api.CaseDefinitionNotFoundException)4 Map (java.util.Map)3 ClassObjectFilter (org.drools.core.ClassObjectFilter)3 RegistryContext (org.drools.core.command.impl.RegistryContext)3 CaseNotFoundException (org.jbpm.casemgmt.api.CaseNotFoundException)3 CaseEventSupport (org.jbpm.casemgmt.impl.event.CaseEventSupport)3 KieSession (org.kie.api.runtime.KieSession)3 FactHandle (org.kie.api.runtime.rule.FactHandle)3 Collection (java.util.Collection)2 Date (java.util.Date)2 LinkedHashMap (java.util.LinkedHashMap)2 CaseRoleInstance (org.jbpm.casemgmt.api.model.instance.CaseRoleInstance)2 CommentInstance (org.jbpm.casemgmt.api.model.instance.CommentInstance)2 CommentInstanceImpl (org.jbpm.casemgmt.impl.model.instance.CommentInstanceImpl)2