Package org.uengine.processdesigner.mapper

Examples of org.uengine.processdesigner.mapper.TransformerMapping


         
          Map options = new HashMap();
          options.put(org.uengine.processdesigner.mapper.Transformer.OPTION_KEY_OUTPUT_ARGUMENT, param.getTransformerMapping().getLinkedArgumentName() );
          options.put(org.uengine.processdesigner.mapper.Transformer.OPTION_KEY_FORM_FIELD_NAME, targetFieldName);
         
          TransformerMapping tm = param.getTransformerMapping();
          Transformer transformer = tm.getTransformer();
         
          value = param.getTransformerMapping().getTransformer().letTransform(instance, options);
          System.out.println(value);
          instance.setBeanProperty(targetFieldName, (Serializable)value);
View Full Code Here


           paramContext.setType((Class)target.getExtendedProperties().get("type"));
         }
        
         source.getTransformer().beforeSerialization();
        
         TransformerMapping transformerMapping = new TransformerMapping();
         transformerMapping.setTransformer(source.getTransformer());
         transformerMapping.setLinkedArgumentName(source.getName());
        
         paramContext.setTransformerMapping(transformerMapping);
        
       }else if (linkedPair.getSource() instanceof Record && linkedPair.getTarget() instanceof Record){
      
View Full Code Here

    
     for(int i=0; i<mappingElements.length; i++){
       MappingElement paramContext = (MappingElement) mappingElements[i];
      
       if(paramContext.getTransformerMapping()!=null){
         TransformerMapping transformerMapping = paramContext.getTransformerMapping();
         Transformer transformer = transformerMapping.getTransformer();
        
         /**
          * ban to add same transformers multiplicitly
          */
         if(!existingTransformers.containsKey(transformer)){
           //need to regenerate the instance of Designer since there's no graphical objects those are deserialized.
           TransformerDesigner tfd = transformer.createDesigner(mapToolPanel.getLinkPanel());
          
           //mapToolPanel.getLinkPanel().add(tfd);
          
           existingTransformers.put(transformer, tfd);
           //transformer.beforeSerialization();
         }

         Record target = (Record) sourceNodes.get(paramContext.getArgument().getText());
         //the output argument of transformer must be the source which should be linked in the first order
         TransformerArgument source = transformer.getTransferArgument(transformerMapping.getLinkedArgumentName());
        
         if(paramContext.isKey()){
           target.setKeyType(Record.KEY);
          }
         
         try{
           mapToolPanel.getModel().addLink(source, target);
         }catch(Exception e){
           e.printStackTrace();
         }
        
         new RecursiveLoop(){

          @Override
          public boolean logic(Object tree) {
            return false;
          }

          @Override
          public List getChildren(Object tree) {
           
            if(tree instanceof TransformerMapping){
              System.out.println();
            }
           
            // stops the recursive tracing when it meets the endpoints           
            if(!(tree instanceof Transformer)){
              return null;
            }
           
            Transformer transformer = (Transformer)tree;
           
            final ArrayList children = new ArrayList();

            if(transformer.getInputArguments()!=null)
            for(int i=0; i<transformer.getInputArguments().length; i++){
              Object argumentSource = transformer.getArgumentSourceMap().get(transformer.getInputArguments()[i]);
              TransformerArgument target = transformer.getTransferArgument(transformer.getInputArguments()[i]);
             
              if(argumentSource==null) continue;
             
              ArrayList argumentSources;
              if(argumentSource instanceof ArrayList){
                argumentSources = (ArrayList)argumentSource;
              }else{
                argumentSources = new ArrayList();
                argumentSources.add(argumentSource);
              }
             
              for(int j=0; j<argumentSources.size(); j++){
                argumentSource = argumentSources.get(j);
               
                if(argumentSource instanceof TransformerMapping){
                  TransformerMapping priorTransformerMapping = (TransformerMapping) argumentSource;
                 
                  Transformer priorTransformer = priorTransformerMapping.getTransformer();
                  argumentSource = priorTransformer;
                 
                  if(!existingTransformers.containsKey(priorTransformer)){
                    TransformerDesigner tfd = priorTransformer.createDesigner(mapToolPanel.getLinkPanel());
                    existingTransformers.put(priorTransformer, tfd);
                  }
                 
                  TransformerArgument priorTransformerArgument = priorTransformer.getTransferArgument(priorTransformerMapping.getLinkedArgumentName());
                  children.add(argumentSource);
 
 
                  if(priorTransformerArgument==null)
                    continue; //anyway never be occurred... means priorTransformerArgument must exist.
View Full Code Here

TOP

Related Classes of org.uengine.processdesigner.mapper.TransformerMapping

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.