Package com.founder.fix.fixflow.core.exception

Examples of com.founder.fix.fixflow.core.exception.FixFlowException


  public static void setField(Field field, Object object, Object value) {
    try {
      field.setAccessible(true);
      field.set(object, value);
    } catch (IllegalArgumentException e) {
      throw new FixFlowException("Could not set field " + field.toString(), e);
    } catch (IllegalAccessException e) {
      throw new FixFlowException("Could not set field " + field.toString(), e);
    }
  }
View Full Code Here


        }
      }
    }

    if (resourceBpmn == null) {
      throw new FixFlowException("发布的流程资源文件必须含有.bpmn");
    }

    byte[] bytes = resourceBpmn.getBytes();
    ResourceSet resourceSet = getResourceSet();
    String tmp = ProcessEngineManagement.getDefaultProcessEngine().getProcessEngineConfiguration().getDefaultTemplatePath();
    String filePath = this.getClass().getClassLoader().getResource(tmp).toString();
    Resource ddddResource = null;
    if (!filePath.startsWith("jar")) {
      try {
        filePath = java.net.URLDecoder.decode(ReflectUtil.getResource(tmp).getFile(), "utf-8");
      } catch (UnsupportedEncodingException e) {
        // TODO 自动生成的 catch 块
        e.printStackTrace();
        throw new FixFlowException("流程定义文件加载失败!", e);
      }
      ddddResource = resourceSet.createResource(URI.createFileURI(filePath));
    } else {
      ddddResource = resourceSet.createResource(URI.createURI(filePath));
    }

    try {
      ddddResource.load(new ByteArrayInputStream(bytes), null);
    } catch (UnsupportedEncodingException e) {
      // TODO Auto-generated catch block
      throw new FixFlowException("定义文件加载失败!", e);
    } catch (IOException e) {
      // TODO Auto-generated catch block
      throw new FixFlowException("定义文件加载失败!", e);
    }

    DefinitionsBehavior definitions = (DefinitionsBehavior) ddddResource.getContents().get(0).eContents().get(0);

    ProcessDefinitionBehavior process = null;
    for (RootElement rootElement : definitions.getRootElements()) {
      if (rootElement instanceof ProcessDefinitionBehavior) {

        // ProcessDefinitionBehavior
        // processObj=(ProcessDefinitionBehavior)rootElement;
        // if(processObj.getProcessDefinitionKey().equals("")){
        process = (ProcessDefinitionBehavior) rootElement;
        break;
        // }

      }
    }
    //增加模型验证,by ych 2013 12 27
    if(process.isVerification()){
      @SuppressWarnings("unused")
      StringBuffer sb = new StringBuffer();
      String result = VerificationUtil.verifyAll(process);
      if(result.length() > 0){
        throw new FixFlowException(result);
      }
    }
    process.setDefinitions(definitions);

    process.setResourceName(resourceBpmn.getName());
View Full Code Here

          }
        }
      }
      return null;
    } catch (SecurityException e) {
      throw new FixFlowException("Not allowed to access method " + setterName + " on class " + clazz.getCanonicalName());
    }
  }
View Full Code Here

  public static Object instantiate(String className, Object[] args) {
    Class< ? > clazz = loadClass(className);
    Constructor< ? > constructor = findMatchingConstructor(clazz, args);
    if (constructor==null) {
      throw new FixFlowException("couldn't find constructor for "+className+" with args "+Arrays.asList(args));
    }
    try {
      return constructor.newInstance(args);
    } catch (Exception e) {
      throw new FixFlowException("couldn't find constructor for "+className+" with args "+Arrays.asList(args), e);
    }
  }
View Full Code Here

        resultStr = rs.getString(1);

      }
    } catch (SQLException e) {
      throw new FixFlowException("查询错误:" + e.getMessage(), e);
    }
    finally
    {
      try {
        pstmt.close();
        if(rs != null){
        rs.close();}
      } catch (SQLException e) {
        throw new FixFlowException("关闭游标失败",e);
      }
    }
    return resultStr;
  }
View Full Code Here

       
          }
        }
      }
    } catch (SQLException e) {
      throw new FixFlowException("查询错误:" + e.getMessage(), e);
    }
   
    finally
    {
      try {
        pstmt.close();
        if(rs != null){
        rs.close();}
      } catch (SQLException e) {
        throw new FixFlowException("关闭游标失败",e);
      }
    }
    return resultMap;
  }
View Full Code Here

        }
        resultList.add(row);
      }
    } catch (SQLException e) {
      throw new FixFlowException("查询错误:" + e.getMessage(), e);
    }
    finally
    {
      try {
        pstmt.close();
        if(rs != null){
          rs.close();
        }
      } catch (SQLException e) {
        throw new FixFlowException("关闭游标失败",e);
      }
    }
    return resultList;
  }
View Full Code Here

      debugLog.debug("FixFlow引擎数据持久化语句: " +sql);
      stmt.execute(sql);
      
     
    } catch (SQLException e) {
      throw new FixFlowException("查询错误:" + e.getMessage(), e);
    }
    finally
    {
      try {
        stmt.close();
      } catch (SQLException e) {
        throw new FixFlowException("关闭游标失败",e);
      }
    }
  }
View Full Code Here

        }
      }
      pstmt.execute();
    } catch (SQLException e) {
      throw new FixFlowException("查询错误:" + e.getMessage(), e);
    }
    finally
    {
      try {
        pstmt.close();
      } catch (SQLException e) {
        throw new FixFlowException("关闭游标失败",e);
      }
    }
   
  }
View Full Code Here

      stmt = conn.createStatement();
      debugLog.debug("FixFlow引擎数据持久化语句: " +sql);
      result = stmt.executeQuery(sql);
     
    } catch (SQLException e) {
      throw new FixFlowException("查询错误:" + e.getMessage(), e);
    }
    finally
    {
      try {
        stmt.close();
        if(result != null){
        result.close();}
      } catch (SQLException e) {
        throw new FixFlowException("关闭游标失败",e);
      }
    }
    return result;
  }
View Full Code Here

TOP

Related Classes of com.founder.fix.fixflow.core.exception.FixFlowException

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.