Search in sources :

Example 1 with CaseCommentCommand

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

the class CaseServiceImpl method removeCaseComment.

@Override
public void removeCaseComment(String caseId, String commentId) throws CaseNotFoundException {
    authorizationManager.checkOperationAuthorization(caseId, ProtectedOperation.MODIFY_COMMENT);
    ProcessInstanceDesc pi = verifyCaseIdExists(caseId);
    processService.execute(pi.getDeploymentId(), ProcessInstanceIdContext.get(pi.getId()), new CaseCommentCommand(identityProvider, commentId, authorizationManager));
}
Also used : CaseCommentCommand(org.jbpm.casemgmt.impl.command.CaseCommentCommand) ProcessInstanceDesc(org.jbpm.services.api.model.ProcessInstanceDesc)

Example 2 with CaseCommentCommand

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

the class CaseServiceImpl method updateCaseComment.

@Override
public void updateCaseComment(String caseId, String commentId, String author, String text, String... restrictedTo) throws CaseNotFoundException {
    authorizationManager.checkOperationAuthorization(caseId, ProtectedOperation.MODIFY_COMMENT);
    ProcessInstanceDesc pi = verifyCaseIdExists(caseId);
    List<String> accessRestriction = null;
    if (restrictedTo != null && restrictedTo.length > 0) {
        accessRestriction = Arrays.asList(restrictedTo);
    }
    processService.execute(pi.getDeploymentId(), ProcessInstanceIdContext.get(pi.getId()), new CaseCommentCommand(identityProvider, commentId, author, text, accessRestriction, authorizationManager));
}
Also used : CaseCommentCommand(org.jbpm.casemgmt.impl.command.CaseCommentCommand) ProcessInstanceDesc(org.jbpm.services.api.model.ProcessInstanceDesc)

Example 3 with CaseCommentCommand

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

the class CaseServiceImpl method addCaseComment.

@Override
public String addCaseComment(String caseId, String author, String comment, String... restrictedTo) throws CaseNotFoundException {
    authorizationManager.checkOperationAuthorization(caseId, ProtectedOperation.MODIFY_COMMENT);
    ProcessInstanceDesc pi = verifyCaseIdExists(caseId);
    List<String> accessRestriction = null;
    if (restrictedTo != null && restrictedTo.length > 0) {
        accessRestriction = Arrays.asList(restrictedTo);
    }
    return processService.execute(pi.getDeploymentId(), ProcessInstanceIdContext.get(pi.getId()), new CaseCommentCommand(identityProvider, author, comment, accessRestriction));
}
Also used : CaseCommentCommand(org.jbpm.casemgmt.impl.command.CaseCommentCommand) ProcessInstanceDesc(org.jbpm.services.api.model.ProcessInstanceDesc)

Aggregations

CaseCommentCommand (org.jbpm.casemgmt.impl.command.CaseCommentCommand)3 ProcessInstanceDesc (org.jbpm.services.api.model.ProcessInstanceDesc)3