Search in sources :

Example 6 with CaseRole

use of org.jbpm.casemgmt.api.model.CaseRole 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

CaseRole (org.jbpm.casemgmt.api.model.CaseRole)6 AdHocFragment (org.jbpm.casemgmt.api.model.AdHocFragment)4 CaseDefinition (org.jbpm.casemgmt.api.model.CaseDefinition)4 Test (org.junit.Test)4 ArrayList (java.util.ArrayList)3 CaseMilestone (org.jbpm.casemgmt.api.model.CaseMilestone)3 CaseStage (org.jbpm.casemgmt.api.model.CaseStage)3 CaseRoleImpl (org.jbpm.casemgmt.impl.model.CaseRoleImpl)3 AbstractCaseServicesBaseTest (org.jbpm.casemgmt.impl.util.AbstractCaseServicesBaseTest)3 HashMap (java.util.HashMap)2 List (java.util.List)2 Map (java.util.Map)2 Set (java.util.Set)2 Collectors (java.util.stream.Collectors)2 QueryContext (org.kie.api.runtime.query.QueryContext)2 Arrays (java.util.Arrays)1 Collection (java.util.Collection)1 Collections (java.util.Collections)1 HashSet (java.util.HashSet)1 Predicate (java.util.function.Predicate)1