Package com.starflow.wf.engine.model

Examples of com.starflow.wf.engine.model.ProcessInstance


      long activityInstId = event.getActivityInst().getActivityInstId();
      event.getActInstRep().updateActivityStateAndFinalTime(activityInstId, StarFlowState.ACT_APP_EXCEPTION, new Date());
      throw new InterruptStrategyException();
    } else if(Constants.ACT_EXCEPTIONSTRATEGY_APPLICATION.equals(exceptionStrategy)) {
      String beanName = activityXml.getExceptionAction();
      ProcessInstance cloneProcessInstance = new ProcessInstance();
      BeanUtils.copyProperties(event.getProcessInstance(), cloneProcessInstance);
      ActivityInst cloneActivityInst = new ActivityInst();
      BeanUtils.copyProperties(event.getActivityInst(), cloneActivityInst);
      executeExceptionAction(beanName, e, cloneProcessInstance, cloneActivityInst)
    } else if(Constants.ACT_EXCEPTIONSTRATEGY_STEPROLLBACK.equals(exceptionStrategy)) {
View Full Code Here


    //判断环节是否处于运行状态,才可完成该工作项
    if(StarFlowState.ACT_INST_RUNING != activityInst.getCurrentState())
      throw new ProcessEngineException("当前环节(activityInstId="+activityInst.getActivityInstId()+")不处于状态,"+
          "无法完成环节的运行!");
   
    final ProcessInstance processInstance = this.procInstRep.findProcessInstance(activityInst.getProcessInstId());
    final ProcessDefine processDefine = this.procDefRep.findProcessDefine(processInstance.getProcessDefId());
    final ActivityElement activityXml = processDefine.getProcessObject().getActivitys().get(activityInst.getActivityDefId());
   
    transactionTemplate.execute(new TransactionCallbackWithoutResult() {
      @Override
      protected void doInTransactionWithoutResult(TransactionStatus status) {
View Full Code Here

      }
    });
  }
 
  public void startActivityInst(long processInstId, String activityDefId) {
    final ProcessInstance processInstance = procInstRep.findProcessInstance(processInstId);
    if(StarFlowState.PROCESS_INST_RUNNING != processInstance.getCurrentState())
      throw new ProcessEngineException("流程不处于运行状态,不能重启环节!");
   
    final ProcessDefine processDefine = this.procDefRep.findProcessDefine(processInstance.getProcessDefId());
    final ActivityElement activityXml = processDefine.getProcessObject().getActivitys().get(activityDefId);
   
    if(activityXml == null)
      throw new ProcessEngineException("指定启动环节【{}】不存在" + activityDefId);
   
View Full Code Here

  public void terminateActivity(final long activityInstId) {
    transactionTemplate.execute(new TransactionCallbackWithoutResult() {
      @Override
      protected void doInTransactionWithoutResult(TransactionStatus status) {
        ActivityInst activityInst = actInstRep.findActivityInst(activityInstId);
        ProcessInstance processInstance = procInstRep.findProcessInstance(activityInst.getProcessInstId());
        EventUtil.publishActivityTerminalEvent(processEngine, processInstance, activityInst);
      }
    });
  }
View Full Code Here

 
  /* (non-Javadoc)
   * @see com.starit.wf.engine.domain.service.IActivityInstService#restartActivity(long)
   */
  public void restartActivity(long processInstId, long activityInstId) {
    ProcessInstance processInstance = procInstRep.findProcessInstance(processInstId);
    if(StarFlowState.PROCESS_INST_RUNNING != processInstance.getCurrentState())
      throw new ProcessEngineException("流程不处于运行状态,不能重启环节!");
   
    ActivityInst activityInst = actInstRep.findActivityInst(activityInstId);
    if(activityInst == null || activityInst.getCurrentState() == StarFlowState.ACT_INST_RUNING
        || activityInst.getCurrentState() == StarFlowState.ACT_INST_WAITING
        || activityInst.getCurrentState() == StarFlowState.ACT_APP_EXCEPTION) {
      throw new ProcessEngineException("环节只有处在完成、终止、应用异常状态,才可以重启环节");
    }
   
//    if(!Constants.ACT_TYPE_MANUL.equals(activityInst.getActivityType())) {
//      throw new ProcessEngineException("只有人工环节才可以重启环节,当前环节类型为:"+activityInst.getActivityType());
//    }
   
    ProcessDefine processDefine = this.procDefRep.findProcessDefine(processInstance.getProcessDefId());
    ActivityElement activityXml = processDefine.getProcessObject().getActivitys().get(activityInst.getActivityDefId());
   
    EventUtil.publishActivityRestartEvent(processEngine, processInstance, activityInst, activityXml);
  }
View Full Code Here

    EventUtil.publishActivityRestartEvent(processEngine, processInstance, activityInst, activityXml);
  }
 
  public void activateActivity(final long activityInstId) {
    final ActivityInst activityInst = actInstRep.findActivityInst(activityInstId);
    final ProcessInstance processInstance = procInstRep.findProcessInstance(activityInst.getProcessInstId());
    final ProcessDefine processDefine = this.procDefRep.findProcessDefine(processInstance.getProcessDefId());
    final ActivityElement activityXml = processDefine.getProcessObject().getActivitys().get(activityInst.getActivityDefId());
   
    transactionTemplate.execute(new TransactionCallbackWithoutResult() {
      @Override
      protected void doInTransactionWithoutResult(TransactionStatus status) {
View Full Code Here

    //判断环节是否处于运行状态,才可执行回退
    if(StarFlowState.ACT_INST_RUNING != activityInst.getCurrentState())
      throw new ProcessEngineException("当前环节(activityInstId="+activityInst.getActivityInstId()+")不处于运行状态,"+
          "不能执行回退。");
   
    final ProcessInstance processInstance = this.procInstRep.findProcessInstance(activityInst.getProcessInstId());
    List<TransCtrl> trans = this.actInstRep.findTransCtrls(activityInst.getProcessInstId());
   
    String recentActDefId = null;
    String destActId = activityInst.getActivityDefId();
    for(TransCtrl transCtrl : trans) {
View Full Code Here

    procDefService.deployProcessFile("classpath:flow/StartActSplitXpathExample.xml");
   
    long start = System.currentTimeMillis();
   
    //启动流程
    ProcessInstance processInstance = procInstService.createProcess("flow.StartActSplitXpathExample", "100001");
   
    Map<String, Object> conditions = new HashMap<String, Object>();
    //宽带处理班
    conditions.put("flag", "<flag>ADSL</flag>");
    RelaDataManager relaDataManager = RelaDataManagerBuilder.buildRelaDataManager();
    long processInstId = processInstance.getProcessInstId();
    String activityDefId = "act_start";
    relaDataManager.setExpressConditions(processInstId, activityDefId, conditions);
   
    //创建流程
    procInstService.startProcess(processInstance.getProcessInstId());
   
    workItemService.finishWorkItem(1l, "100001");
    workItemService.finishWorkItem(2l, "100001");
   
    long end = System.currentTimeMillis();
View Full Code Here

    procDefService.deployProcessFile("classpath:flow/StartActivityExample.xml");

    long start = System.currentTimeMillis();
     
      //启动流程
    ProcessInstance processInstance = procInstService.createAndStartProcess("flow.StartActivityExample", "100001");
    activityInstService.startActivityInst(processInstance.getProcessInstId(), "Act_3");
   
    long end = System.currentTimeMillis();
    System.out.println("总用时:" + (end - start) + "毫秒");
    //总用时:13641毫秒
  }
View Full Code Here

    long start = System.currentTimeMillis();
    long j = 1;
    for(int i=0; i<10; i++) {
     
      //启动流程
      ProcessInstance processInstance = procInstService.createProcess("flow.SimpleExample", "100001");
      //创建流程
      procInstService.startProcess(processInstance.getProcessInstId());
     
      //List<WorkItem> workItems = workItemService.queryPersonWorkItems("melin");
      workItemService.finishWorkItem(j++, "910150");
      workItemService.finishWorkItem(j++, "100001");
      System.out.println("---------------------"+i+"次------------------------------");
View Full Code Here

TOP

Related Classes of com.starflow.wf.engine.model.ProcessInstance

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.