Package org.activiti.rest.exception

Examples of org.activiti.rest.exception.ActivitiConflictException


        if (varScope != sharedScope) {
          throw new ActivitiIllegalArgumentException("Only allowed to update multiple variables in the same scope.");
        }
       
        if (!override && hasVariableOnScope(execution, var.getName(), varScope)) {
          throw new ActivitiConflictException("Variable '" + var.getName() + "' is already present on execution '" + execution.getId() + "'.");
        }
       
        Object actualVariableValue = restResponseFactory.getVariableValue(var);
        variablesToSet.put(var.getName(), actualVariableValue);
        resultVariables.add(restResponseFactory.createRestVariable(var.getName(), actualVariableValue, varScope,
View Full Code Here


        if (varScope != sharedScope) {
          throw new ActivitiIllegalArgumentException("Only allowed to update multiple variables in the same scope.");
        }
       
        if (hasVariableOnScope(task, var.getName(), varScope)) {
          throw new ActivitiConflictException("Variable '" + var.getName() + "' is already present on task '" + task.getId() + "'.");
        }
       
        Object actualVariableValue = restResponseFactory.getVariableValue(var);
        variablesToSet.put(var.getName(), actualVariableValue);
        resultVariables.add(restResponseFactory.createRestVariable(var.getName(), actualVariableValue, varScope,
View Full Code Here

    throw new ActivitiIllegalArgumentException("Invalid action: '" + actionRequest.getAction() + "'.");
  }
 
  protected ProcessInstanceResponse activateProcessInstance(ProcessInstance processInstance, String serverRootUrl) {
    if (!processInstance.isSuspended()) {
      throw new ActivitiConflictException("Process instance with id '" +
          processInstance.getId() + "' is already active.");
    }
    runtimeService.activateProcessInstanceById(processInstance.getId());
  
    ProcessInstanceResponse response = restResponseFactory.createProcessInstanceResponse(processInstance, serverRootUrl);
View Full Code Here

    return response;
  }

  protected ProcessInstanceResponse suspendProcessInstance(ProcessInstance processInstance, String serverRootUrl) {
    if (processInstance.isSuspended()) {
      throw new ActivitiConflictException("Process instance with id '" +
          processInstance.getId() + "' is already suspended.");
    }
    runtimeService.suspendProcessInstanceById(processInstance.getId());
   
    ProcessInstanceResponse response = restResponseFactory.createProcessInstanceResponse(processInstance, serverRootUrl);
View Full Code Here

 
  protected ProcessDefinitionResponse activateProcessDefinition(ProcessDefinition processDefinition, boolean suspendInstances,
      Date date, boolean isGraphicalNotationDefined, String serverRootUrl) {
   
    if (!processDefinition.isSuspended()) {
      throw new ActivitiConflictException("Process definition with id '" + processDefinition.getId() + " ' is already active");
    }
    repositoryService.activateProcessDefinitionById(processDefinition.getId(), suspendInstances, date);
  
    ProcessDefinitionResponse response = restResponseFactory.createProcessDefinitionResponse(processDefinition, isGraphicalNotationDefined, serverRootUrl);
   
View Full Code Here

  protected ProcessDefinitionResponse suspendProcessDefinition(ProcessDefinition processDefinition, boolean suspendInstances,
      Date date, boolean isGraphicalNotationDefined, String serverRootUrl) {
   
    if (processDefinition.isSuspended()) {
      throw new ActivitiConflictException("Process definition with id '" + processDefinition.getId() + " ' is already suspended");
    }
    repositoryService.suspendProcessDefinitionById(processDefinition.getId(), suspendInstances, date);
   
    ProcessDefinitionResponse response = restResponseFactory.createProcessDefinitionResponse(processDefinition, isGraphicalNotationDefined, serverRootUrl);
   
View Full Code Here

      throw new ActivitiIllegalArgumentException("Id cannot be null.");
    }

    // Check if a user with the given ID already exists so we return a CONFLICT
    if (identityService.createUserQuery().userId(userRequest.getId()).count() > 0) {
      throw new ActivitiConflictException("A user with id '" + userRequest.getId() + "' already exists.");
    }
   
    User created = identityService.newUser(userRequest.getId());
    created.setEmail(userRequest.getEmail());
    created.setFirstName(userRequest.getFirstName());
View Full Code Here

    if (identityService.createUserQuery()
        .memberOfGroup(group.getId())
        .userId(memberShip.getUserId())
        .count() > 0) {
    
        throw new ActivitiConflictException("User '" + memberShip.getUserId() +
             "' is already part of group '" + group.getId() + "'.");
    }
  
    identityService.createMembership(memberShip.getUserId(), group.getId());
    response.setStatus(HttpStatus.CREATED.value());
View Full Code Here

      throw new ActivitiIllegalArgumentException("The value cannot be null.");
    }
   
    String existingValue = identityService.getUserInfo(user.getId(), userRequest.getKey());
    if (existingValue != null) {
      throw new ActivitiConflictException("User info with key '" + userRequest.getKey() + "' already exists for this user.");
    }
   
    identityService.setUserInfo(user.getId(), userRequest.getKey(), userRequest.getValue());
   
    response.setStatus(HttpStatus.CREATED.value());
View Full Code Here

      throw new ActivitiIllegalArgumentException("Id cannot be null.");
    }

    // Check if a user with the given ID already exists so we return a CONFLICT
    if (identityService.createGroupQuery().groupId(groupRequest.getId()).count() > 0) {
      throw new ActivitiConflictException("A group with id '" + groupRequest.getId() + "' already exists.");
    }
   
    Group created = identityService.newGroup(groupRequest.getId());
    created.setId(groupRequest.getId());
    created.setName(groupRequest.getName());
View Full Code Here

TOP

Related Classes of org.activiti.rest.exception.ActivitiConflictException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.