Package com.founder.fix.fixflow.core.exception

Examples of com.founder.fix.fixflow.core.exception.FixFlowException


        if(pathObject != null){
          path = pathObject.toString()
        }
      }
      if(path == null){
        throw new FixFlowException("path不能为空");
      }
    String [] pathArr = path.split(",");
    String type = pathArr[0];
   
    String tmpPathString = "";
View Full Code Here


      }
      if(path == null){
        path = getParameterFromPayload(body, "path");
      }
      if(path == null){
        throw new FixFlowException("path不能为空");
      }
    String [] pathArr = path.split(",");
    String type = pathArr[0];
   
    String tmpPathString = "";
View Full Code Here

 
 
  public T execute(CommandContext commandContext) {
   
    if(Authentication.getAuthenticatedUserId()==null||Authentication.getAuthenticatedUserId().equals("")){
      throw new FixFlowException("登录用户不能!");
    }
    // TODO Auto-generated method stub
    Object[] obj = new Object[] {expandTaskCommand}
   
   
    TaskCommandDef taskCommandDef= commandContext.getProcessEngineConfigurationImpl().getTaskCommandDefMap().get(this.expandTaskCommand.getCommandType());
    if(taskCommandDef!=null){
      String classNameString=taskCommandDef.getCmd();
      if(classNameString==null||classNameString.equals("")){
        throw new FixFlowException("配置文件中ID为 "+this.expandTaskCommand.getCommandType() + " 的扩展配置cmd属性不能为空!");
      }
     
      String commandClassNameString=taskCommandDef.getCommand();
      if(commandClassNameString==null||commandClassNameString.equals("")){
        throw new FixFlowException("配置文件中ID为 "+this.expandTaskCommand.getCommandType() + " 的扩展配置command属性不能为空!");
      }
     
      //commandClassNameString
      AbstractCustomExpandTaskCommand abstractCustomExpandTaskCommand=(AbstractCustomExpandTaskCommand)ReflectUtil.instantiate(commandClassNameString, obj);
     
      Object[] objTemp = new Object[] {abstractCustomExpandTaskCommand}
      @SuppressWarnings("unchecked")
      AbstractExpandTaskCmd<A,T> abstractExpandTaskCmd=(AbstractExpandTaskCmd<A,T>)ReflectUtil.instantiate(classNameString, objTemp);
      return (T) abstractExpandTaskCmd.execute(commandContext);
     
    }
    else{
      throw new FixFlowException("配置文件中不存在ID为 "+this.expandTaskCommand.getCommandType() + " 的扩展配置.");
    }
 

  }
View Full Code Here

 

  public Void execute(CommandContext commandContext) {
   
    if (processInstanceId == null || processInstanceId.equals("")) {
      throw new FixFlowException("流程实例编号为空!");
    }

    // 创建流程实例管理器
    ProcessInstanceManager processInstanceManager = commandContext.getProcessInstanceManager();

    // 获取流程实例
    ProcessInstanceEntity processInstanceImpl = processInstanceManager.findProcessInstanceById(processInstanceId);

   
    if(!processInstanceImpl.isSuspended()){
      throw new FixFlowException("流程实例没有暂停,不能恢复");
    }
   
    //恢复流程实例
    processInstanceImpl.resume();
 
    try {
      // 持久化实例
      processInstanceManager.saveProcessInstance(processInstanceImpl);
    } catch (Exception e) {
      throw new FixFlowException("流程实例持久化失败!", e);
    }
    return null;
  }
View Full Code Here

  }

  public Void execute(CommandContext commandContext) {

    if (processInstanceId == null || processInstanceId.equals("")) {
      throw new FixFlowException("流程实例编号为空!");
    }

    // 创建流程实例管理器
    ProcessInstanceManager processInstanceManager = commandContext.getProcessInstanceManager();

    // 获取流程实例
    ProcessInstanceEntity processInstanceImpl = processInstanceManager.findProcessInstanceById(processInstanceId);

    // 结束流程实例
    processInstanceImpl.termination();
 
    try {
      // 持久化实例
      processInstanceManager.saveProcessInstance(processInstanceImpl);
    } catch (Exception e) {
      throw new FixFlowException("流程实例持久化失败!", e);
    }
    return null;

  }
View Full Code Here

  }

  public Void execute(CommandContext commandContext) {

    if (taskId == null) {
      throw new FixFlowException("任务编号为空!");
    }

    TaskInstanceEntity taskInstance = Context.getCommandContext().getTaskManager().findTaskById(taskId);

    if (taskInstance == null) {
      throw new FixFlowException("无法找到编号为: " + taskId + " 的任务!");
    }
    if (transferUserId != null) {
      if (taskInstance.getAssignee() == null) {

        throw new FixFlowException("任务 " + taskId + " 无代理人!");

      } else {

        String nodeId = taskInstance.getNodeId();
        String processDefinitionId = taskInstance.getProcessDefinitionId();

        ProcessDefinitionManager processDefinitionManager = commandContext.getProcessDefinitionManager();

        ProcessDefinitionBehavior processDefinition = processDefinitionManager.findLatestProcessDefinitionById(processDefinitionId);

        UserTaskBehavior userTask = (UserTaskBehavior) processDefinition.getDefinitions().getElement(nodeId);

        TaskCommandInst taskCommand = userTask.getTaskCommandsMap().get(userCommandId);

        taskInstance.setEndTime(ClockUtil.getCurrentTime());
        taskInstance.setCommandId(taskCommand.getId());
        taskInstance.setCommandType(StringUtil.getString(taskCommand.getTaskCommandType()));
        taskInstance.setCommandMessage(taskCommand.getName());
        taskInstance.setTaskComment(taskComment);

        Context.getCommandContext().getTaskManager().saveTaskInstanceEntity(taskInstance);

        taskInstance.setId(GuidUtil.CreateGuid());
        taskInstance.setAssignee(transferUserId);
        taskInstance.setCreateTime(ClockUtil.getCurrentTime());
        taskInstance.setEndTime(null);
        taskInstance.setCommandType(null);
        taskInstance.setCommandMessage(null);
        taskInstance.setTaskComment(null);
        Context.getCommandContext().getTaskManager().saveTaskInstanceEntity(taskInstance);
      }
    } else {
      throw new FixFlowException("转发人不能为空!");
    }

    return null;

  }
View Full Code Here

    this.zipInputStream = zipInputStream;
    this.deploymentBuilder = deploymentBuilder;
  }
  public String execute(CommandContext commandContext) {
    if(zipInputStream == null){
      throw new FixFlowException("Zip文件不能为空");
    }
    deploymentBuilder.addZipInputStream(zipInputStream);
    return deploymentBuilder.deploy().getId();
  }
View Full Code Here

    this.cascade = cascade;
  }

  public Void execute(CommandContext commandContext) {
    if (deploymentId == null) {
      throw new FixFlowException("deploymentId 不能为空");
    }

    commandContext.getDeploymentManager().deleteDeployment(deploymentId,
        cascade);
View Full Code Here

    ProcessDefinitionBehavior processDefinition = null;
    if (processDefinitionId != null) {
      processDefinition = processDefinitionManager.findLatestProcessDefinitionById(processDefinitionId);
      if (processDefinition == null) {
        throw new FixFlowException("通过 processDefinitionId 没有找到指定流程 = '" + processDefinitionId + "'");
      }
    } else if (processDefinitionKey != null) {
      processDefinition = processDefinitionManager.findLatestProcessDefinitionByKey(processDefinitionKey);
      if (processDefinition == null) {
        throw new FixFlowException("通过 processDefinitionKey 没有找到指定流程 '" + processDefinitionKey + "'");
      }
    } else {
      throw new FixFlowException("processDefinitionKey 和 processDefinitionId 不能都为空");
    }

    ProcessInstanceEntity processInstanceEntity = null;
    try {
     
      processInstanceEntity =  processDefinition.createProcessInstance(businessKey);

      processInstanceEntity.setStartAuthor(startAuthor);
      processInstanceEntity.getContextInstance().setTransientVariableMap(transientVariables);
      processInstanceEntity.getContextInstance().setVariableMap(variables);
 
      BaseElement baseElement=processDefinition.getDefinitions().getElement(nodeId);
     
      if(baseElement !=null){
        processInstanceEntity.start((FlowNode)baseElement);
      }
      else{
        throw new FixFlowException("没有找到messageId为 "+ messageId+" 的消息启动节点");
      }
     
     

     
     
     
      commandContext.getProcessInstanceManager().saveProcessInstance(processInstanceEntity);

    } catch (Exception e) {
      throw new FixFlowException("流程实例启动异常! "+ e.getMessage(), e);
    }

    return processInstanceEntity;
  }
View Full Code Here

    ProcessDefinitionBehavior processDefinition = null;
    if (processDefinitionId != null) {
      processDefinition = processDefinitionManager.findLatestProcessDefinitionById(processDefinitionId);
      if (processDefinition == null) {
        throw new FixFlowException("通过 processDefinitionId 没有找到指定流程 = '" + processDefinitionId + "'");
      }
    } else if (processDefinitionKey != null) {
      processDefinition = processDefinitionManager.findLatestProcessDefinitionByKey(processDefinitionKey);
      if (processDefinition == null) {
        throw new FixFlowException("通过 processDefinitionKey 没有找到指定流程 '" + processDefinitionKey + "'");
      }
    } else {
      throw new FixFlowException("processDefinitionKey 和 processDefinitionId 不能都为空");
    }

    ProcessInstanceEntity processInstanceEntity = null;
    try {
     
      processInstanceEntity =  processDefinition.createProcessInstance(businessKey);

      processInstanceEntity.setStartAuthor(startAuthor);
      processInstanceEntity.getContextInstance().setTransientVariableMap(transientVariables);
      processInstanceEntity.getContextInstance().setVariableMap(variables);
 

      processInstanceEntity.start();
     
     
      commandContext.getProcessInstanceManager().saveProcessInstance(processInstanceEntity);

    } catch (Exception e) {
      throw new FixFlowException("流程实例启动异常! "+ e.getMessage(), e);
    }

    return processInstanceEntity;
  }
View Full Code Here

TOP

Related Classes of com.founder.fix.fixflow.core.exception.FixFlowException

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.