Package com.starflow.wf.engine.model.elements

Examples of com.starflow.wf.engine.model.elements.ProcessElement


    Date nowDate = new Date();
    ProcessEngine processEngine = event.getProcessEngine();
    activityInst.setCurrentState(StarFlowState.ACT_INST_COMPLETED);
    activityInst.setEndTime(nowDate);
   
    ProcessElement processXml = event.getProcessXml();
    ActivityElement activityXml = processXml.getActivitys().get(activityInst.getActivityDefId());
    String actType = activityXml.getType();
   
    //判断当前环节是否可以结束
    boolean completeFlag = isCompleteActivity(activityXml, event);
    if(!completeFlag)
View Full Code Here


  @Override
  public void processStart(ProcessStartEvent event) {
    ProcessInstance processInstance = event.getProcessInstance();
    ProcessEngine processEngine = event.getProcessEngine();
    ProcessElement processXml = event.getProcessXml();
   
    //设置流程实例为运行状态
    event.getProcInstFacade().updateProcessStateAndStartTime(processInstance.getProcessInstId(),
        StarFlowState.PROCESS_INST_RUNNING, new Date());
   
    //执行流程开始filter
    for(ProcessFilter filter : processEngine.getProcessFilters()) {
      filter.processStart(event);
    }
   
    //流程启动后触发事件
    TriggerProcessEventUtil.afterStart(processEngine, null, processInstance,
        processXml.getEvents());
   
    StartActivityType type = (StartActivityType)ActivityTypeFactory.buildActivityType(Constants.ACT_TYPE_START);
    ActivityElement activityXml = processXml.getActivitys().get(StarFlowNames.ACT_START_ID);
    ActivityInst activityInst = type.createActivity(event, activityXml);
   
    EventUtil.publishActivityStartEvent(event, activityInst, activityXml);
  }
View Full Code Here

  public ProcessDefine findProcessDefine(long processDefId) {
    ProcessDefine processDefine = getCacheValue("prodef-" + processDefId);
    if(processDefine == null || processDefine.getProcessObject() == null) {
      processDefine = this.getJdbcTemplate().queryForObject(findProcessDefineSQL, new ProcessDefineRowMapper(), processDefId);
     
      ProcessElement processXml = ProcessDefineParser.createProcessXml(processDefine.getProcessDefContent());
      processDefine.setProcessObject(processXml);
      cache.put("prodef-" + processDefine.getProcessDefId(), processDefine);
    }
    return processDefine;
  }
View Full Code Here

  public ProcessDefine findPublishProcessDefine(String processDefName) {
    ProcessDefine processDefine = getCacheValue("prodef-" + processDefName);
    if(processDefine == null) {
      processDefine = this.getJdbcTemplate().queryForObject(findPublishProcessDefineSQL, new ProcessDefineRowMapper(), processDefName);
     
      ProcessElement processXml = ProcessDefineParser.createProcessXml(processDefine.getProcessDefContent());
      processDefine.setProcessObject(processXml);
      cache.put("prodef-" + processDefine.getProcessDefId(), processDefine);
      cache.put("prodef-" + processDefine.getProcessDefName(), processDefine);
    }
    return processDefine;
View Full Code Here

    }
    return document;
  }
 
  public static ProcessElement createProcessXml(String xml) {
    ProcessElement processXml = new ProcessElement();
    Document document = createDocument(xml);
    queryProcessXmlInfo(processXml, document);
    processXml.setTransitions(queryTransitionXmlInfo(document));
    processXml.setActivitys(queryActivityXmlInfo(processXml, document));
    return processXml;
  }
View Full Code Here

TOP

Related Classes of com.starflow.wf.engine.model.elements.ProcessElement

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.