Package com.dtrules.mapping

Examples of com.dtrules.mapping.DataMap$XmlLoader


     * mapping which provides information about these Data Objects.
     * @return
     */
    @SuppressWarnings("deprecation")
    public DataMap getDataMap(Mapping map, String tag){
        DataMap datamap = new DataMap(this, map,tag,null);
        registerMap(datamap);
        return datamap;
    }
View Full Code Here


     * mapping which provides information about these Data Objects.
     * @return
     */
    @SuppressWarnings("deprecation")
    public DataMap getDataMap(Mapping map, String tag){
        DataMap datamap = new DataMap(this, map,tag,null);
        registerMap(datamap);
        return datamap;
    }
View Full Code Here

    
     public void loadData(IRSession session, String path, String dataset)throws Exception {
       InputStream input = new FileInputStream(path+"/"+dataset);
       if( harnessVersion() < 2){
           Mapping   mapping  = session.getMapping();
           DataMap datamap = session.getDataMap(mapping,null);
           datamap.loadXML(input);
           mapping.loadData(session, datamap);
          
           this.datamap = datamap;
       }else{
         AutoDataMap autoDataMap = session.getRuleSet().getAutoDataMap(session, mapName());
View Full Code Here

     * mapping which provides information about these Data Objects.
     * @return
     */
    @SuppressWarnings("deprecation")
    public DataMap getDataMap(Mapping map, String tag){
        DataMap datamap = new DataMap(this, map,tag,null);
        registerMap(datamap);
        return datamap;
    }
View Full Code Here

     * into the Rules Engine, you need to use this call, providing the
     * mapping which provides information about these Data Objects.
     * @return
     */
    public DataMap getDataMap(Mapping map, String tag){
        DataMap datamap = new DataMap(map,tag,null);
        registerMap(datamap);
        return datamap;
    }
View Full Code Here

            
             // Map the data from the job into the Rules Engine
             
             // First create a data map.
             Mapping     mapping  = session.getMapping();
           DataMap   datamap  = session.getDataMap(mapping,null);
          
           datamap.opentag(job,"job");
           datamap.readDO(job, "job");
          
             Case c = job.getCase();
             datamap.opentag(c,"case");
             datamap.readDO(c,"case");
               for(Client client : c.getClients()){
                 datamap.opentag(client,"client");
                 datamap.readDO(client,"client");
                   for(Income income : client.getIncomes()){
                    
                       datamap.readDO(income,"income");
                      
                   }
                 datamap.closetag();
               }
               for(Relationship r : c.getRelationships()){
                 datamap.opentag("relationship");
                   datamap.printdata("type", r.getType());
                   datamap.readDO(r.getSource(), "source");
                   datamap.readDO(r.getTarget(), "target");
                 datamap.closetag();
               }
             datamap.closetag();
            
           datamap.closetag();
          
             int    id  = job.getId();
            
             if(app.save >0 && id % app.save == 0){
               String cnt = ""+id;
                 for(;id<100000;id*=10)cnt = "0"+cnt;
                 try {
                   datamap.print(new FileOutputStream(app.getOutputDirectory()+"job_"+cnt+".xml"));
                 } catch (Exception e) {
                   System.out.println("Couldn't write to '"+app.getOutputDirectory()+"job_"+cnt+".xml'");
                 }
             }
            
View Full Code Here

                         
             // Map the data from the job into the Rules Engine
             
             // First create a data map.
             Mapping     mapping  = session.getMapping();
           DataMap   datamap  = session.getDataMap(mapping,"BookPreview");
          
           request.write2DataMap(datamap);
          
             int    id  = request.getId();
            
             if(app.save >0 && id % app.save == 0){
               String cnt = ""+id;
                 for(;id<100000;id*=10)cnt = "0"+cnt;
                 try {
                   datamap.print(new FileOutputStream(app.getOutputDirectory()+"BP_request_"+cnt+".xml"));
                 } catch (Exception e) {
                   System.out.println("Couldn't write to '"+app.getOutputDirectory()+"BP_request_"+cnt+".xml'");
                 }
             }
            
View Full Code Here

    
     public void loadData(IRSession session, String path, String dataset)throws Exception {
       InputStream input = new FileInputStream(path+"/"+dataset);
       if( harnessVersion() < 2){
           Mapping   mapping  = session.getMapping();
           DataMap datamap = session.getDataMap(mapping,null);
           datamap.loadXML(input);
           mapping.loadData(session, datamap);
          
           this.datamap = datamap;
       }else{
         AutoDataMap autoDataMap = session.getRuleSet().getAutoDataMap(session, mapName());
View Full Code Here

     * mapping which provides information about these Data Objects.
     * @return
     */
    @SuppressWarnings("deprecation")
    public DataMap getDataMap(Mapping map, String tag){
        DataMap datamap = new DataMap(this, map,tag,null);
        registerMap(datamap);
        return datamap;
    }
View Full Code Here

           
            for(int i=1;i<=numCases; i++){
                if(i>0 && i%inc   ==0 )ostream.print(i+" ");
                if(i>0 && i%lines ==0 )ostream.print("\n");
                OutputStream out = new FileOutputStream(filename(name,numCases,i));
                DataMap datamap = session.getDataMap(session.getMapping(),testObj.getRuleSetName());
               
                DataObj request = generate();
                request.write2DataMap(datamap);
                datamap.print(out);
            }
        } catch (FileNotFoundException e) {
            ostream.println(e.toString());
            e.printStackTrace();
        }
View Full Code Here

TOP

Related Classes of com.dtrules.mapping.DataMap$XmlLoader

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.