Package com.starflow.wf.engine.model

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


  }

  public void setProcessInstance(ProcessInstance processInstance) {
    this.processInstance = processInstance;
    IProcessDefineRepository procDefFacade = this.getApplicationContext().getBean(IProcessDefineRepository.class);
    ProcessDefine processDefine = procDefFacade.findProcessDefine(processInstance.getProcessDefId());
    processXml = processDefine.getProcessObject();
  }
View Full Code Here


  }
 
  public void deleteProcessDefine(long processDefId) {
    this.getJdbcTemplate().update(deleteProcessDefineSQL, processDefId);
   
    ProcessDefine processDefine = getCacheValue("prodef-" + processDefId);
    if(processDefine != null) {
      cache.evict("prodef-" + processDefine.getProcessDefId());
      cache.evict("prodef-" + processDefine.getProcessDefName());
    }
  }
View Full Code Here

      cache.evict("prodef-" + processDefine.getProcessDefName());
    }
  }
 
  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

    }
    return processDefine;
  }
 
  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

  }
 
  public void updateProcessDefineUnPublishStatus(String processDefName) {
    this.getJdbcTemplate().update(updateProcessDefineUnPublishStatusSQL, processDefName);
   
    ProcessDefine processDefine = getCacheValue("prodef-" + processDefName);
    if(processDefine != null) {
      cache.evict("prodef-" + processDefine.getProcessDefName());
    }
  }
View Full Code Here

  }
 
  public void updateProcessDefinePublishStatus(long processDefId) {
    this.getJdbcTemplate().update(updateProcessDefinePublishStatusSQL, processDefId);
   
    ProcessDefine processDefine = findProcessDefine(processDefId);
    if(processDefine != null) {
      cache.evict("prodef-" + processDefine.getProcessDefName());
    }
  }
View Full Code Here

    return this.getJdbcTemplate().query(findProcessDefinesSQL, new RowMapper<ProcessDefine>(){

      @Override
      public ProcessDefine mapRow(ResultSet resultSet, int index)
          throws SQLException {
        ProcessDefine processDefine = new ProcessDefine();
        processDefine.setProcessDefId(resultSet.getLong("processDefId"));
        processDefine.setProcessDefName(resultSet.getString("processDefName"));
        processDefine.setProcessCHName(resultSet.getString("processCHName"));
        processDefine.setCurrentState(resultSet.getInt("currentState"));
        processDefine.setVersionSign(resultSet.getString("versionSign"));
        return processDefine;
      }
     
    }, processDefName);
  }
View Full Code Here

 
  private static class ProcessDefineRowMapper implements RowMapper<ProcessDefine> {
    @Override
    public ProcessDefine mapRow(ResultSet resultSet, int index)
        throws SQLException {
      ProcessDefine processDefine = new ProcessDefine();
      processDefine.setProcessDefId(resultSet.getLong("processDefId"));
      processDefine.setProcessDefName(resultSet.getString("processDefName"));
      processDefine.setProcessCHName(resultSet.getString("processCHName"));
      processDefine.setCurrentState(resultSet.getInt("currentState"));
      processDefine.setVersionSign(resultSet.getString("versionSign"));
      processDefine.setDescription(resultSet.getString("description"));
      processDefine.setCreateTime(resultSet.getDate("createTime"));
      processDefine.setCreator(resultSet.getString("creator"));
      processDefine.setUpdateTime(resultSet.getDate("updateTime"));
      processDefine.setUpdator(resultSet.getString("updator"));
      processDefine.setLimitTime(resultSet.getLong("limitTime"));
      processDefine.setProcessDefContent(resultSet.getString("processDefContent"));
      return processDefine;
    }
View Full Code Here

  public void deployProcessXML(final String processDefContent) {
    transactionTemplate.execute(new TransactionCallbackWithoutResult() {
      @Override
      public void doInTransactionWithoutResult(TransactionStatus status) {
        ProcessDefine processDefine = new ProcessDefine();
        long id = PrimaryKeyUtil.getPrimaryKey(Keys.PROCESSDEFID);
        processDefine.setProcessDefId(id);
       
        processDefine.setProcessDefContent(processDefContent);
        Dom4jProcDefParser.parserProcessInfo(processDefine);
        processDefine.setCreateTime(new Date());
        processDefine.setCurrentState(StarFlowState.PROCESS_DEF_PUBLISH);
       
        procDefRep.inertProcessDefine(processDefine);
      }
    });
  }
View Full Code Here

  public Map<String, String> getProcessProperties(final Long processDefId) {
    return transactionTemplate.execute(new TransactionCallback<Map<String, String>>() {

      @Override
      public Map<String, String> doInTransaction(TransactionStatus status) {
        ProcessDefine processDefine = procDefRep.findProcessDefine(processDefId);
        return processDefine.getProcessObject().getProperties();
      }
    });
  }
View Full Code Here

TOP

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

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.