Package org.uengine.persistence.dao

Examples of org.uengine.persistence.dao.WorkListDAO


  public static WorklistDAOType getInstance(TransactionContext tc) throws Exception{
    return (WorklistDAOType)getInstance(WorklistDAOType.class, tc);
  }
 
  public WorkListDAO createDAOImpl(String sql) throws Exception {
    WorkListDAO dao = (WorkListDAO)ConnectiveDAO.createDAOImpl(getTransactionContext(), sql, WorkListDAO.class);
    return dao;
  }
View Full Code Here


    WorkListDAO dao = (WorkListDAO)ConnectiveDAO.createDAOImpl(getTransactionContext(), sql, WorkListDAO.class);
    return dao;
  }
 
  public int[] updateDueDateByTaskId( String[] taskIds, Date dueDate ) throws Exception {
    WorkListDAO worklistDAO = createDAOImpl(updateDueDateByTaskId_SQL);
   
    if(taskIds!=null){
      for(int i=0; i<taskIds.length; i++){
        worklistDAO.setTaskId(new Long(taskIds[i]));
        worklistDAO.setDueDate(dueDate);
        worklistDAO.addBatch();
      }
     
      return worklistDAO.updateBatch();
    }
   
    return new int[]{};
  }
View Full Code Here

   
    //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);
View Full Code Here

       
        return eventHandlerSPs;
    }
   
    public WorkListDAO getWorkList() {
        WorkListDAO wl = null;
        try {
            DefaultConnectionFactory defaultConnectionFactory = DefaultConnectionFactory.create();
           
            wl = (WorkListDAO) GenericDAO.createDAOImpl(
                    defaultConnectionFactory,
                    "select * from bpm_worklist where rootinstid=?rootinstid",
                    WorkListDAO.class
            );
           
            wl.setRootInstId(new Long(getProcessInstId()));
            wl.select();
           
        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
View Full Code Here

          priority = new Integer(priorityStr);
        }catch(Exception e){
        }
      }
     
      final WorkListDAO wl;
     
      Long taskId;
      if(reservedTaskId!=null){
        taskId = new Long(reservedTaskId);
        wl = (WorkListDAO) tc.findSynchronizedDAO("BPM_WORKLIST", "taskId", taskId, WorkListDAO.class);
      }
      else{
        taskId = UniqueKeyGenerator.issueWorkItemKey(tc);
        wl = (WorkListDAO) tc.createSynchronizedDAO("BPM_WORKLIST", "taskId", taskId, WorkListDAO.class);
      }

      if(dueDate!=null)
        wl.setDueDate(dueDate.getTime());
      else
        wl.setDueDate(null);

      String definitionName = (String)parameterMap.get("definitionName");
      String instanceName = (String)parameterMap.get("instanceName");
      String instanceId = (String)parameterMap.get(KeyedParameter.INSTANCEID);
     
/*      if(definitionName!=null){
        wl.setProcessDefinitionName(definitionName);
      }
      if(instanceName!=null){
        wl.setProcessInstanceName(instanceName);
      }
*/ 
     
     
      wl.setPriority(priority);
      wl.setTool(""+parameterMap.get(KeyedParameter.TOOL));
      wl.setEndpoint(userId);

      //modified
      Timestamp startedTime;
//      if(tc.getProcessManager().getGenericContext().containsKey("initiationTime")){
//        String startedTimeInStr = (String)tc.getProcessManager().getGenericContext().get("initiationTime");
//        startedTime = new Timestamp(Long.parseLong(startedTimeInStr));
//      }else
        startedTime = new Timestamp(now.getTimeInMillis());
      wl.setStartDate(startedTime);
      //end
     
      wl.setTitle(""+parameterMap.get(KeyedParameter.TITLE));
      wl.setTrcTag(""+parameterMap.get(KeyedParameter.TRACINGTAG));
      wl.setInstId(new Long(""+parameterMap.get(KeyedParameter.INSTANCEID)));
      wl.setRootInstId(new Long(""+parameterMap.get(KeyedParameter.ROOTINSTANCEID)));
      wl.setDefId(new Long(""+parameterMap.get(KeyedParameter.PROCESSDEFINITION)));
      wl.setDefName(""+parameterMap.get(KeyedParameter.PROCESSDEFINITIONNAME));
      wl.setRoleName(""+parameterMap.get("roleName"));
      wl.setRefRoleName(""+parameterMap.get("referenceRoleName"));
      wl.setResName(""+parameterMap.get("resourceName"));
     
      int i=1;
      while(parameterMap.containsKey("dispatchParam" + i)){
        wl.set("DispatchParam" +i, ""+parameterMap.get("dispatchParam" + i));
        i++;
      }
     
      if(parameterMap.containsKey("executionScope")){
        wl.setExecScope((String)parameterMap.get("executionScope"));
      }
           
      if(parameterMap.containsKey("extValue1")){
        wl.set("EXT1", parameterMap.get("extValue1"));
      }
      if(parameterMap.containsKey("extValue2")){
        wl.set("EXT2", parameterMap.get("extValue2"));
      }
      if(parameterMap.containsKey("extValue3")){
        wl.set("EXT3", parameterMap.get("extValue3"));
      }
      if(parameterMap.containsKey("extValue4")){
        wl.set("EXT4", parameterMap.get("extValue4"));
      }
      if(parameterMap.containsKey("extValue5")){
        wl.set("EXT5", parameterMap.get("extValue5"));
      }
      if(parameterMap.containsKey("extValue6")){
        wl.set("EXT6", parameterMap.get("extValue6"));
      }
      if(parameterMap.containsKey("extValue7")){
        wl.set("EXT7", parameterMap.get("extValue7"));
      }
      if(parameterMap.containsKey("extValue8")){
        wl.set("EXT8", parameterMap.get("extValue8"));
      }
      if(parameterMap.containsKey("extValue9")){
        wl.set("EXT9", parameterMap.get("extValue9"));
      }
      if(parameterMap.containsKey("extValue10")){
        wl.set("EXT10", parameterMap.get("extValue10"));
      }
     
      //dispatching option//////
      try{
        int dispatchingOption = Integer.parseInt((String)parameterMap.get(KeyedParameter.DISPATCHINGOPTION))
        wl.setDispatchOption(dispatchingOption);
      }catch(Exception e){
        wl.setDispatchOption(Role.DISPATCHINGOPTION_ALL);
      }
      //parameterMap.remove(KeyedParameter.DISPATCHINGOPTION);
      //
     
      setExtendedFields(wl, parameterMap);
     
      //status//////
      String defaultStatus = parameterMap.containsKey(KeyedParameter.DEFAULT_STATUS) ?
          ""+parameterMap.get(KeyedParameter.DEFAULT_STATUS)
          :
          (isReservation ? DefaultWorkList.WORKITEM_STATUS_RESERVED : DefaultWorkList.WORKITEM_STATUS_NEW);     
      wl.setStatus(defaultStatus);
      //
     
      //parameter map////// don't use parameter map anymore
      //if(!DAOFactory.getInstance(tc).getDBMSProductName().startsWith("DB2")){
      //  ByteArrayOutputStream bao = new ByteArrayOutputStream();
View Full Code Here

  public void cancelWorkItem(String taskID, KeyedParameter[] options, TransactionContext tc)
    throws RemoteException {
     
    try{
     
      WorkListDAO wl = (WorkListDAO) tc.findSynchronizedDAO("BPM_WORKLIST", "taskId", new Long(taskID), WorkListDAO.class);
      wl.setStatus(DefaultWorkList.WORKITEM_STATUS_CANCELLED);
      for(int i=0; i<options.length; i++){
        KeyedParameter parameter = options[i];
        if("status".equals(parameter.getKey()) && UEngineUtil.isNotEmpty((String)parameter.getValue())){
          wl.setStatus(((String)parameter.getValue()).toUpperCase());
        }
      }
     
     
    }catch(Exception e){
View Full Code Here

    try{
      DAOFactory daoFactory = DAOFactory.getInstance(tc);
      Calendar now = daoFactory.getNow();

      WorkListDAO wl = (WorkListDAO) tc.findSynchronizedDAO("BPM_WORKLIST", "taskId", new Long(taskID), WorkListDAO.class);
      wl.setStatus(DefaultWorkList.WORKITEM_STATUS_COMPLETED);
      wl.setEndDate(new Timestamp(now.getTimeInMillis()));
     
    }catch(Exception e){
      throw new RemoteException("ExtWorkList", e);
    }
  }
View Full Code Here

//      wlDAO.getImplementationObject().setTableName("bpm_worklist");
//      wlDAO.getImplementationObject().setKeyField("taskId");
//      wlDAO.getImplementationObject().setAutoSQLGeneration(true);
//      wlDAO.setTaskId(new Long(taskId));

      WorkListDAO wlDAO = (WorkListDAO) tc.findSynchronizedDAO("BPM_WORKLIST", "taskId", new Long(taskId), WorkListDAO.class);

      if(userId!=null)
        wlDAO.setEndpoint(userId);
     
      for(int i=0; i<parameters.length; i++){
        KeyedParameter parameter = parameters[i];
       
        if(KeyedParameter.DISPATCHINGOPTION.equals(parameter.getKey())){
          wlDAO.setDispatchOption(Integer.parseInt(""+parameter.getValue()));
        }else
        if("dispatchParam1".equals(parameter.getKey())){
          wlDAO.setDispatchParam1(""+parameter.getValue());
        }else
                if(KeyedParameter.DUEDATE.equals(parameter.getKey())){
          wlDAO.setDueDate((Date)parameter.getValue());
                }else
                if(KeyedParameter.DEFAULT_STATUS.equals(parameter.getKey())){
          wlDAO.setStatus((String)parameter.getValue());
                }else
                if("endDate".equals(parameter.getKey())){
            wlDAO.setEndDate((Date)parameter.getValue());
                }else
                if("saveDate".equals(parameter.getKey())){ //임시저장 시간 저장 (11.23)
              wlDAO.setSaveDate((Date)parameter.getValue());
                }
      }
     
      //wlDAO.update();   
     
View Full Code Here

TOP

Related Classes of org.uengine.persistence.dao.WorkListDAO

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.