Package com.founder.fix.fixflow.core.impl.runtime

Examples of com.founder.fix.fixflow.core.impl.runtime.ProcessInstanceEntity


    ProcessDefinitionManager processDefinitionManager = commandContext.getProcessDefinitionManager();

    ProcessDefinitionBehavior processDefinition = processDefinitionManager.findLatestProcessDefinitionById(processDefinitionId);

    ProcessInstanceEntity processInstanceImpl = processInstanceManager.findProcessInstanceById(processInstanceId, processDefinition);

    TokenEntity token=processInstanceImpl.getTokenMap().get(tokenId);
   
   
   
    List<String> tokenIdList=new ArrayList<String>();
   
View Full Code Here


      }
    } 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);
 

     
      StartEventBehavior startEvent=(StartEventBehavior)processDefinition.getTimeStartEvent(this.nodeId);
     
      processInstanceEntity.timeStart(this.nodeId);
     
      //
      if(startEvent.isPersistence()){
        commandContext.getProcessInstanceManager().saveProcessInstance(processInstanceEntity);
      }
      else{
        System.out.println("=====流程 "+processInstanceEntity.getId()+" 未持久化启动 " + new Date() + " =====");
      }
     
     
     
View Full Code Here

      ProcessDefinitionBehavior processDefinition = processDefinitionManager.findLatestProcessDefinitionById(processDefinitionId);

     
     
      ProcessInstanceEntity processInstanceImpl = processInstanceManager.findProcessInstanceById(processInstanceId, processDefinition);

   

      List<TaskInstanceEntity> taskInstances = processInstanceImpl.getTaskMgmtInstance().getTaskInstanceEntitys();

      for (TaskInstanceEntity taskInstance : taskInstances) {
        if (taskInstance.getId().equals(taskId)) {
       
         
View Full Code Here

    this.taskId=jobExecutionContext.getJobDetail().getJobDataMap().getString("taskId");
  }
 
  public Void execute(CommandContext commandContext) {
   
    ProcessInstanceEntity processInstance=commandContext.getProcessInstanceManager().findProcessInstanceById(this.processInstanceId);
   
    TokenEntity token=processInstance.getTokenMap().get(this.tokenId);
   
    ExecutionContext executionContext=ProcessObjectFactory.FACTORYINSTANCE.createExecutionContext(token);
   
   
    if(this.taskId!=null&&!this.taskId.equals("")){
      TaskInstanceEntity taskInstanceEntity=processInstance.getTaskMgmtInstance().getTaskInstanceEntitys(taskId);
      executionContext.setTaskInstance(taskInstanceEntity);
    }
   
    if(this.connectorId!=null&&!this.connectorId.equals("")){
     
      FlowNodeImpl flowNode=(FlowNodeImpl)processInstance.getProcessDefinition().getDefinitions().getElement(this.nodeId);
      BaseElementEvent baseElementEvent=flowNode.getEvent(this.eventType);
      List<ConnectorInstanceBehavior> connectors=baseElementEvent.getConnectors();
      ConnectorInstanceBehavior connectorDefinition=null;
      for (ConnectorInstanceBehavior connectorDefinitionObj : connectors) {
        if(connectorDefinitionObj.getConnectorInstanceId().equals(this.connectorInstanceId)){
View Full Code Here

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

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

   
    if(processInstanceImpl.isSuspended()){
      throw new FixFlowException("流程实例已经暂停,不能再次暂停");
    }
   
    if(processInstanceImpl.hasEnded()){
      throw new FixFlowException("流程实例已经结束,不能暂停");
    }
   
    //暂停流程实例
    processInstanceImpl.suspend();
 
    try {
      // 持久化实例
      processInstanceManager.saveProcessInstance(processInstanceImpl);
    } catch (Exception e) {
View Full Code Here

    ProcessDefinitionBehavior processDefinition = processDefinitionManager.findLatestProcessDefinitionById(processInstance.getProcessDefinitionId());

   

    ProcessInstanceEntity processInstanceImpl = processInstanceManager.findProcessInstanceById(processInstanceId, processDefinition);
    TokenEntity tokenEntity = processInstanceImpl.getTokenMap().get(tokenId);
    processInstanceImpl.getContextInstance().setTransientVariableMap(transientVariables);
   
    if(nodeId==null){
      Event event=(Event)tokenEntity.getFlowNode();
      if(event instanceof BoundaryEvent){
        BoundaryEvent boundaryEvent=(BoundaryEvent)event;
View Full Code Here

   

    ProcessDefinitionBehavior processDefinitionBehavior = Context.getCommandContext().getProcessDefinitionManager()
        .findLatestProcessDefinitionByKeyAndVersion(flowId, version);

    ProcessInstanceEntity subProcessInstance = new ProcessInstanceEntity(processDefinitionBehavior, bizKey,
        executionContext.getProcessInstance(), executionContext.getToken());

    subProcessInstance.setStartAuthor(Authentication.getAuthenticatedUserId());

    DataSourceToSubProcessMapping dataSourceToSubProcessMapping=getDataSourceToSubProcessMapping();
    if(dataSourceToSubProcessMapping!=null){
      for (DataVariableMapping dataVariableMapping :dataSourceToSubProcessMapping.getDataVariableMapping()) {

        String dataSourceId = "${" + dataVariableMapping.getDataSourceId() + "}";

        subProcessInstance.getContextInstance().addDataVariable(dataVariableMapping.getSubProcesId(),
            ExpressionMgmt.execute(dataSourceId, executionContext));

      }

    }
   
   
    try {

      subProcessInstance.noneStart();

      ProcessInstanceManager processInstanceManager = Context.getCommandContext().getProcessInstanceManager();

      processInstanceManager.saveProcessInstance(subProcessInstance);

    } catch (Exception e) {

      throw new FixFlowException("子流程 " + this.getName() + " 启动异常!", e);

    }

    createSubTask(executionContext, subProcessInstance.getId());

    return subProcessInstance.getId();

  }
View Full Code Here

      }
    }
   
   
    if(taskInstance!=null){
      ProcessInstanceEntity processInstanceEntity=Context.getCommandContext().getProcessInstanceManager().findProcessInstanceById(taskInstance.getProcessInstanceId());
      if(processInstanceEntity!=null){
        ExecutionContext executionContext=ProcessObjectFactory.FACTORYINSTANCE.createExecutionContext(processInstanceEntity.getRootToken());
        for (TaskCommandInst taskCommandInstObj : taskCommandInstsNew) {
          taskCommandInstObj.clearParamMap();
          taskCommandInstObj.execExpressionParam(executionContext,null);
        }
      }
View Full Code Here

    ProcessDefinitionManager processDefinitionManager = commandContext.getProcessDefinitionManager();

    ProcessDefinitionBehavior processDefinition = processDefinitionManager.findLatestProcessDefinitionById(processDefinitionId);

    ProcessInstanceEntity processInstanceImpl = processInstanceManager.findProcessInstanceById(processInstanceId, processDefinition);

    TokenEntity token=processInstanceImpl.getTokenMap().get(tokenId);
   
   
   
    List<String> tokenIdList=new ArrayList<String>();
   
View Full Code Here

    ProcessDefinitionManager processDefinitionManager = Context.getCommandContext().getProcessDefinitionManager();

    ProcessDefinitionBehavior processDefinition = processDefinitionManager.findLatestProcessDefinitionById(processDefinitionId);

    ProcessInstanceEntity processInstanceImpl = processInstanceManager.findProcessInstanceById(processInstanceId, processDefinition);

    TokenEntity token = processInstanceImpl.getTokenMap().get(tokenId);

    ExecutionContext executionContext = ProcessObjectFactory.FACTORYINSTANCE.createExecutionContext(token);
   
   
    UserTaskBehavior userTask = (UserTaskBehavior) processDefinition.getDefinitions().getElement(nodeId);
View Full Code Here

TOP

Related Classes of com.founder.fix.fixflow.core.impl.runtime.ProcessInstanceEntity

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.