Package com.dtrules.session

Examples of com.dtrules.session.RuleSet


     *                    assumed that this Entity already exists.
     * @return true if the attribute was successfully added.
   */
  public boolean createAttribute(final String rulesetname, final REntityEntry attribute) {
        try {
            RuleSet  rs     = getRuleset(rulesetname);
            IREntity entity = rs.getEntityFactory(session).findRefEntity(attribute.attribute);
            entity.addAttribute(attribute);
            return true;
        } catch (RulesException e) {
            return false;
        }
View Full Code Here


     * @param entityname    The entity name of intrest.
     * @return              The list of Entity Entries that define the attributes of the Entity
     */
    public List<REntityEntry> getEntityEntries(String rulesetname, String entityname){
        ArrayList<REntityEntry> entries = new ArrayList<REntityEntry>();
        RuleSet                 rs      = getRuleset(rulesetname);
        IREntity entity;
        try {
            entity = rs.getEntityFactory(session).findRefEntity(RName.getRName(entityname));
            Iterator<RName>         attribs = entity.getAttributeIterator();
           
            while(attribs.hasNext()){
                entries.add(entity.getEntry(attribs.next()));
            }
View Full Code Here

    /**
     * Create a new Decision Table
     */
  public RDecisionTable createDecisionTable(String rulesetname, String decisiontablename)
            throws RulesException{
    RuleSet rs     = getRuleset(rulesetname);
        return rs.getEntityFactory(session).newDecisionTable(decisiontablename,session);
  }
View Full Code Here

   * @see com.dtrules.admin.IRulesAdminService#getAttributes(java.lang.String, java.lang.String)
   */
  public List getAttributes(String rulesetname, String entityName) {
        if(rd==null)return null;
        try {
            RuleSet rs = rd.getRuleSet(RName.getRName(rulesetname));
            Iterator it = rs.getEntityFactory(session)
                          .findRefEntity(RName.getRName(entityName)).getAttributeIterator();
            return getList(it);
        } catch (RulesException e) {
            return null;
        }
View Full Code Here

  /* (non-Javadoc)
   * @see com.dtrules.admin.IRulesAdminService#getDecisionTable(java.lang.String, java.lang.String)
   */
  public RDecisionTable getDecisionTable(String rulesetname, String DecisionTableName) {
        try {
            RuleSet rs = rd.getRuleSet(RName.getRName(rulesetname));
            return rs.getEntityFactory(session)
                   .findTable(RName.getRName(DecisionTableName));
        } catch (RulesException e) {
            return null;
        }
  }
View Full Code Here

   * @see com.dtrules.admin.IRulesAdminService#getDecisionTables(java.lang.String)
   */
  public List getDecisionTables(String rulesetname) {
    if(rd==null)return null;
        try {
            RuleSet rs = rd.getRuleSet(RName.getRName(rulesetname));
            Iterator it = rs.getEntityFactory(session).getDecisionTableRNameIterator();
            return getList(it);
        } catch (RulesException e) {
            return null;
        }
  }
View Full Code Here

    /**
     * Updates the Decision Table XML specified in the RuleSet with the Decision Tables as
     * currently held in memory. 
     */
    public void saveDecisionTables(RSession session, String rulesetname) throws RulesException {
        RuleSet       rs       = rd.getRuleSet(RName.getRName(rulesetname));
        String        filepath = rs.getFilepath();
        String        filename = rs.getDT_XMLName();
       
        OutputStream out;
        try {
            out = new FileOutputStream(filepath+filename);
        } catch (FileNotFoundException e) {
View Full Code Here

     * @param session The session which gives us the outputstreams for debug statements and trace statements
     * @param rulesetname The Rule Set to be written out to the output stream
     * @throws RulesException
     */
  public void saveDecisionTables(OutputStream out, RSession session, String rulesetname) throws RulesException {
      RuleSet       rs       = rd.getRuleSet(RName.getRName(rulesetname));
        EntityFactory ef       = rs.getEntityFactory(session);
       
        PrintStream  ps  = new PrintStream(out);
        Iterator<RName> tables = ef.getDecisionTableRNameIterator();
        ps.println("<decision_tables>");
        while(tables.hasNext()){
View Full Code Here

    public static void main(String args[]){
        String path = "C:\\eclipse\\workspace\\EB_POC\\new_york_EB\\xml\\";
        String file = path + "DTRules.xml";   
   
        RulesDirectory    rd      = new RulesDirectory("",file);
        RuleSet           rs      = rd.getRuleSet(RName.getRName("ebdemo"));
        RSession          session;
        try {
            OutputStream  out     = new FileOutputStream("c:\\temp\\dt.xml");
                          session = new RSession(rs);
            RulesAdminService admin   = new RulesAdminService(session, rd);
View Full Code Here

            System.out.println(e1.toString());
        }
    }

    public void saveEDD(RSession session, String rulesetname) throws RulesException {
        RuleSet       rs       = rd.getRuleSet(RName.getRName(rulesetname));
        EntityFactory ef       = rs.getEntityFactory(session);
        String        filepath = rs.getFilepath();
        String        filename = rs.getEDD_XMLName();
       
        OutputStream out;
        try {
            out = new FileOutputStream(filepath+filename);
        } catch (FileNotFoundException e) {
View Full Code Here

TOP

Related Classes of com.dtrules.session.RuleSet

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.