Search in sources :

Example 1 with ModifyRoleAssignmentCommand

use of org.jbpm.casemgmt.impl.command.ModifyRoleAssignmentCommand in project jbpm by kiegroup.

the class CaseServiceImpl method assignToCaseRole.

/*
     * Case role assignment methods
     */
@Override
public void assignToCaseRole(String caseId, String role, OrganizationalEntity entity) throws CaseNotFoundException {
    authorizationManager.checkOperationAuthorization(caseId, ProtectedOperation.MODIFY_ROLE_ASSIGNMENT);
    ProcessInstanceDesc pi = verifyCaseIdExists(caseId);
    processService.execute(pi.getDeploymentId(), ProcessInstanceIdContext.get(pi.getId()), new ModifyRoleAssignmentCommand(identityProvider, role, entity, true));
}
Also used : ModifyRoleAssignmentCommand(org.jbpm.casemgmt.impl.command.ModifyRoleAssignmentCommand) ProcessInstanceDesc(org.jbpm.services.api.model.ProcessInstanceDesc)

Example 2 with ModifyRoleAssignmentCommand

use of org.jbpm.casemgmt.impl.command.ModifyRoleAssignmentCommand in project jbpm by kiegroup.

the class CaseServiceImpl method removeFromCaseRole.

@Override
public void removeFromCaseRole(String caseId, String role, OrganizationalEntity entity) throws CaseNotFoundException {
    authorizationManager.checkOperationAuthorization(caseId, ProtectedOperation.MODIFY_ROLE_ASSIGNMENT);
    ProcessInstanceDesc pi = verifyCaseIdExists(caseId);
    processService.execute(pi.getDeploymentId(), ProcessInstanceIdContext.get(pi.getId()), new ModifyRoleAssignmentCommand(identityProvider, role, entity, false));
}
Also used : ModifyRoleAssignmentCommand(org.jbpm.casemgmt.impl.command.ModifyRoleAssignmentCommand) ProcessInstanceDesc(org.jbpm.services.api.model.ProcessInstanceDesc)

Aggregations

ModifyRoleAssignmentCommand (org.jbpm.casemgmt.impl.command.ModifyRoleAssignmentCommand)2 ProcessInstanceDesc (org.jbpm.services.api.model.ProcessInstanceDesc)2