Package org.activiti.engine

Examples of org.activiti.engine.ActivitiException


 
  protected String userId;
 
  public CreateUserCmd(String userId) {
    if(userId == null) {
      throw new ActivitiException("userId is null");
    }
    this.userId = userId;
  }
View Full Code Here


    if (is != null) {
      InputRepresentation output = new InputRepresentation(is);
      return output;
   
    } else if (form != null){
      throw new ActivitiException("The form for task '" + taskId + "' cannot be rendered using the rest api.");
   
    } else {
      throw new ActivitiException("There is no form for task '" + taskId + "'.");
    }
  }
View Full Code Here

  }

  public Object execute(CommandContext commandContext) {

    if (taskId == null) {
      throw new ActivitiException("taskId is null");
    }
    commandContext
      .getHistoricTaskInstanceManager()
      .deleteHistoricTaskInstanceById(taskId);
    return null;
View Full Code Here

      return null;

    String processDefinitionId = (String) getRequest().getAttributes().get("processDefinitionId");

    if (processDefinitionId == null) {
      throw new ActivitiException("No process definition id provided");
    }

    RepositoryService repositoryService = ActivitiUtil.getRepositoryService();
    ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery()
        .processDefinitionId(processDefinitionId).singleResult();

    if (processDefinition == null) {
      throw new ActivitiException("Process definition " + processDefinitionId + " could not be found");
    }

    if (processDefinition.getDiagramResourceName() == null) {
      throw new ActivitiException("Diagram resource could not be found");
    }
    final InputStream definitionImageStream = repositoryService.getResourceAsStream(
        processDefinition.getDeploymentId(), processDefinition.getDiagramResourceName());

    if (definitionImageStream == null) {
      throw new ActivitiException("Diagram resource could not be found");
    }
    return new InputRepresentation(definitionImageStream, MediaType.IMAGE_PNG);
  }
View Full Code Here

 
  protected String groupId;
 
  public CreateGroupCmd(String groupId) {
    if(groupId == null) {
      throw new ActivitiException("groupId is null");
    }
    this.groupId = groupId;
  }
View Full Code Here

    }
  }

  public ProcessDefinitionEntity findDeployedProcessDefinitionById(String processDefinitionId) {
    if (processDefinitionId == null) {
      throw new ActivitiException("Invalid process definition id : null");
    }
    ProcessDefinitionEntity processDefinition = Context
      .getCommandContext()
      .getProcessDefinitionManager()
      .findLatestProcessDefinitionById(processDefinitionId);
    if(processDefinition == null) {
      throw new ActivitiException("no deployed process definition found with id '" + processDefinitionId + "'");
    }
    processDefinition = resolveProcessDefinition(processDefinition);
    return processDefinition;
  }
View Full Code Here

    ProcessDefinitionEntity processDefinition = Context
      .getCommandContext()
      .getProcessDefinitionManager()
      .findLatestProcessDefinitionByKey(processDefinitionKey);
    if (processDefinition==null) {
      throw new ActivitiException("no processes deployed with key '"+processDefinitionKey+"'");
    }
    processDefinition = resolveProcessDefinition(processDefinition);
    return processDefinition;
  }
View Full Code Here

  public Object getPersistentState() {
    return value;
  }

  public void setId(String id) {
    throw new ActivitiException("only provided id generation allowed for properties");
  }
View Full Code Here

              variables.put(name, valueNode.asText());
            }
          }
        }
      } catch(Exception e) {
        throw new ActivitiException("Did not receive the operation parameters", e);
      }
     
      variables.remove("taskId");
      ActivitiUtil.getFormService().submitTaskFormData(taskId, variables);
     
    } else {
      throw new ActivitiException("'" + operation + "' is not a valid operation");
    }
   
    ObjectNode successNode = new ObjectMapper().createObjectNode();
    successNode.put("success", true);
    return successNode;
View Full Code Here

    ProcessDefinitionEntity processDefinition = (ProcessDefinitionEntity) Context
      .getCommandContext()
      .getProcessDefinitionManager()
      .findProcessDefinitionByKeyAndVersion(processDefinitionKey, processDefinitionVersion);
    if (processDefinition==null) {
      throw new ActivitiException("no processes deployed with key = '" + processDefinitionKey + "' and version = '" + processDefinitionVersion + "'");
    }
    processDefinition = resolveProcessDefinition(processDefinition);
    return processDefinition;
  }
View Full Code Here

TOP

Related Classes of org.activiti.engine.ActivitiException

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.