Package org.uengine.persistence.processinstance

Examples of org.uengine.persistence.processinstance.ProcessInstanceDAO


      } else {
        targetProcessInstanceId = new Long(instance.getRootProcessInstanceId());
      }
     
      ProcessInstanceDAOType piDAOF = ProcessInstanceDAOType.getInstance(instance.getProcessTransactionContext());
      ProcessInstanceDAO piDAO = piDAO = piDAOF.getSiblingProcessInstances(targetProcessInstanceId, this.isTerminateRunAndForgetSubProcess());

      Hashtable options = new Hashtable();
      options.put("ptc", instance.getProcessTransactionContext());

      while (piDAO.next()) {
        ProcessInstance theInstance = ProcessInstance.create().getInstance(piDAO.getInstId().toString(), options);
        theInstance.stop(terminateStatus);
        if (targetPI != null && targetPI.isSubProcess()) {
          targetPI.getProcessDefinition().returnToMainProcess(targetPI);
        }
      }
View Full Code Here


    fd = type.getFieldDescriptor("ListFieldType");
   
    //ArrayList fieldNames = new ArrayList();
    ArrayList fieldValues = new ArrayList();
    try {
      ProcessInstanceDAO piDAO;
      WorkListDAO wlDAO;
 
      wlDAO = (org.uengine.persistence.dao.WorkListDAO)GenericDAO.createDAOImpl(org.uengine.persistence.dao.WorkListDAO.class);
     
      for(Iterator i = wlDAO.getImplementationObject().getPropertyTypes().keySet().iterator(); i.hasNext();){
        String fieldName = (String)i.next();
        //fieldNames.add(fieldName);
        WorkListTableListFieldType listFieldType = new WorkListTableListFieldType();
        listFieldType.setFieldName(fieldName);
        fieldValues.add(listFieldType);
      }
     
      piDAO = (ProcessInstanceDAO)GenericDAO.createDAOImpl(ProcessInstanceDAO.class);
     
      for(Iterator i = piDAO.getImplementationObject().getPropertyTypes().keySet().iterator(); i.hasNext();){
        String fieldName = (String)i.next();
        //fieldNames.add(fieldName);
        InstanceTableListFieldType listFieldType = new InstanceTableListFieldType();
        listFieldType.setFieldName(fieldName);
        fieldValues.add(listFieldType);
View Full Code Here

       
        return pdr;
    }
   
    public ProcessInstanceDAO getEventHandler() {
        ProcessInstanceDAO eventHandlerSPs = null;
       
        try {
            DefaultConnectionFactory defaultConnectionFactory = DefaultConnectionFactory.create();
           
            eventHandlerSPs = (ProcessInstanceDAO)GenericDAO.createDAOImpl(
                    defaultConnectionFactory,
                    "select * from bpm_procinst where maininstid=?maininstid and isDeleted=0",
                    ProcessInstanceDAO.class
            );
           
            eventHandlerSPs.setMainInstId(new Long(getProcessInstId()));
            eventHandlerSPs.select();
        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
       
View Full Code Here

  }
 
  public void applyChanges() throws Exception{
    MeasuringContext mc = new MeasuringContext("EJBProcessInstance:applyChanges()");
   
    ProcessInstanceDAO procInsDAO = getProcessInstanceDAO();
    procInsDAO.getImplementationObject().setTableName("BPM_PROCINST");
    procInsDAO.getImplementationObject().setKeyField("INSTID");
    procInsDAO.setModDate(GlobalContext.getNow(getProcessTransactionContext()).getTime());
   
    if(isNew){
      procInsDAO.getImplementationObject().createInsertSql();
    }else{
      procInsDAO.getImplementationObject().createUpdateSql();
    }
   
   
    //TODO Checking for dirty field is needed
    procInsDAO.update();

    mc.printElapsedTime(this);

    if(modifiedKeyMap!=null){
      //System.out.println("modifiedKeyMap.size() ===========================> " + modifiedKeyMap.size());
View Full Code Here

  }
 
  protected void setStatus(String scope, String status) throws Exception{
    super.setStatus(scope, status);
   
    ProcessInstanceDAO piDAO = null;
    //forward status of pi to processinstance
    if(scope.equals("")){
      //remove if this instance doesn't need to be archived       
      if(status.equals(Activity.STATUS_COMPLETED) && !getProcessDefinition().isArchive())
        remove()
      else{
        piDAO = getProcessInstanceDAO();
        piDAO.setStatus(status);
      }
     
      //when the instance is completed or stopped.
      if(status.equals(Activity.STATUS_COMPLETED) || status.equals(Activity.STATUS_STOPPED)){
        if(piDAO==null){         
          piDAO = getProcessInstanceDAO();
        }
         
        piDAO.setFinishedDate(GlobalContext.getNow(getProcessTransactionContext()).getTime());
       
        archive();
      }
    }
View Full Code Here

  Boolean isSubProcess = null;
  public boolean isAdhocProcess() throws Exception {
    if(isSubProcess==null){
      try{
        ProcessInstanceDAO piDAO = getProcessInstanceDAO();
        isSubProcess = Boolean.valueOf(piDAO.getIsAdhoc());                   
      }catch(Exception e){
        isSubProcess = Boolean.valueOf(false);
      }
    }
   
View Full Code Here

//          throw new UEngineException("There is same version already exists. Choose another version.");
         
          //FIXME: implement for non-ejb version.
          if(!"org.uengine.kernel.DefaultProcessInstance".equals(GlobalContext.getPropertyString("processinstance.class"))){
            ProcessInstanceDAOType pidaotype = ProcessInstanceDAOType.getInstance(tc);
            ProcessInstanceDAO existingInstances = pidaotype.findByDefinitionVersion(pdvr.getDefVerId());
            if(existingInstances.size()>0){
              throw new UEngineException("There is some instances belonged to this definition already exists. Choose another version number.");
            }
          }
          overwrite = true;
          verifyModifiedDateWhenOverwriting = false;
View Full Code Here

TOP

Related Classes of org.uengine.persistence.processinstance.ProcessInstanceDAO

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.