Search in sources :

Example 1 with AddDataCaseFileInstanceCommand

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

the class CaseServiceImpl method addDataToCaseFile.

/*
     * Case file data methods
     */
@Override
public void addDataToCaseFile(String caseId, String name, Object value, String... restrictedTo) throws CaseNotFoundException {
    authorizationManager.checkOperationAuthorization(caseId, ProtectedOperation.ADD_DATA);
    ProcessInstanceDesc pi = verifyCaseIdExists(caseId);
    List<String> accessRestriction = null;
    if (restrictedTo != null) {
        accessRestriction = Arrays.asList(restrictedTo);
    }
    Map<String, Object> parameters = new HashMap<>();
    parameters.put(name, value);
    processService.execute(pi.getDeploymentId(), ProcessInstanceIdContext.get(pi.getId()), new AddDataCaseFileInstanceCommand(identityProvider, parameters, accessRestriction, authorizationManager));
}
Also used : HashMap(java.util.HashMap) ProcessInstanceDesc(org.jbpm.services.api.model.ProcessInstanceDesc) AddDataCaseFileInstanceCommand(org.jbpm.casemgmt.impl.command.AddDataCaseFileInstanceCommand)

Example 2 with AddDataCaseFileInstanceCommand

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

the class CaseServiceImpl method addDataToCaseFile.

@Override
public void addDataToCaseFile(String caseId, Map<String, Object> data, String... restrictedTo) throws CaseNotFoundException {
    authorizationManager.checkOperationAuthorization(caseId, ProtectedOperation.ADD_DATA);
    ProcessInstanceDesc pi = verifyCaseIdExists(caseId);
    List<String> accessRestriction = null;
    if (restrictedTo != null) {
        accessRestriction = Arrays.asList(restrictedTo);
    }
    processService.execute(pi.getDeploymentId(), ProcessInstanceIdContext.get(pi.getId()), new AddDataCaseFileInstanceCommand(identityProvider, data, accessRestriction, authorizationManager));
}
Also used : ProcessInstanceDesc(org.jbpm.services.api.model.ProcessInstanceDesc) AddDataCaseFileInstanceCommand(org.jbpm.casemgmt.impl.command.AddDataCaseFileInstanceCommand)

Aggregations

AddDataCaseFileInstanceCommand (org.jbpm.casemgmt.impl.command.AddDataCaseFileInstanceCommand)2 ProcessInstanceDesc (org.jbpm.services.api.model.ProcessInstanceDesc)2 HashMap (java.util.HashMap)1