Package com.founder.fix.fixflow.service

Examples of com.founder.fix.fixflow.service.FlowCenterService


              "select * from DEMOTABLE where COL1=?", params);
         
          if(res!=null && res.size()>0)
            filter.put("demoObject", res.get(0));

          FlowCenterService fcs = getFlowCenter();
          Map<String, Object> list = fcs.GetFlowRefInfo(filter);
          filter.putAll(list);
          request.setAttribute("result", filter);
          rd = request.getRequestDispatcher("/fixflow/demo/doTask.jsp");
        }finally{
          connection.close();         
        }
      } else if (action.equals("demoCompleteTask")) {// 演示如何完成下一步
        //这里直接打开了DB_FIX_BIZ_BASE库
        Connection connection = FixFlowShellProxy
            .getConnection(ConnectionManagement.defaultDataBaseId);
        PreparedStatement ps = null;

        try {
          //设置这里开始jdbc级别事务
          connection.setAutoCommit(false);
          ps = connection
              .prepareStatement("insert into DEMOTABLE(COL1,COL2) values(?,?)");
          ps.setObject(1, filter.get("businessKey"));
          ps.setObject(2, filter.get("COL2"));
          ps.execute();
          FlowCenterService fcs = getFlowCenter();
          fcs.setConnection(connection);
          fcs.completeTask(filter);

          //事务提交
          connection.commit();
        } catch(Exception e){
          //事务回滚
          connection.rollback();
          throw e;
        }finally {
          rd = request
              .getRequestDispatcher("/fixflow/common/result.jsp");
          if (ps != null)
            ps.close();
          connection.close();
        }
      } else if (action.equals("demoDoNext")) {// 演示如何在流程已经发起后继续往下运行
        //这里直接打开了DB_FIX_BIZ_BASE库
        Connection connection = FixFlowShellProxy
            .getConnection(ConnectionManagement.defaultDataBaseId);
        try{
          //设置这里开始jdbc级别事务
          connection.setAutoCommit(false);
          String taskParams = StringUtil.getString(filter
              .get("taskParams"));
          Map<String, Object> flowMaps = JSONUtil
              .parseJSON2Map(taskParams);
          filter.put("taskParams", flowMaps);
          FlowCenterService fcs = getFlowCenter();
          fcs.setConnection(connection);
          fcs.completeTask(filter);
          //事务提交
          connection.commit();
        }catch(Exception e){
          connection.rollback();
          throw e;
View Full Code Here

TOP

Related Classes of com.founder.fix.fixflow.service.FlowCenterService

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.