Package org.uengine.processdesigner.mapper

Examples of org.uengine.processdesigner.mapper.TransformerArgument


    public void removeLink(LinkedPair lp){
        if(linkedPairs.containsKey(lp.getId( ))) linkedPairs.remove(lp.getId( ));
        //removeLinkElement(lp.getId( ));

        if(lp.getTarget() instanceof TransformerArgument){
          TransformerArgument ta = ((TransformerArgument)lp.getTarget());
          ta.getTransformer().getArgumentSourceMap().remove(ta.getName());
          ta.removeHardLinkSource((Linkable) lp.getSource());
        }
       
        fireLinkRemovedEvent(lp);
    }
View Full Code Here


    SchemaTreeModel stm = (SchemaTreeModel) (getLinkPanel().getTargetTree().getModel());

    Linkable dummyNode = (Linkable) stm.getNodesIndexedByName().get("dummy1");
   
    for(int i=0; i<getOutputArguments().length; i++){
      TransformerArgument outputTA = getTransferArgument(getOutputArguments()[i]);
     
      getLinkPanel().addLink(outputTA, dummyNode);
    }
   
    super.afterAdded();
View Full Code Here

     while(iter.hasNext()){
       LinkedPair linkedPair = (LinkedPair) iter.next();
       ParameterContext paramContext = null;
      
       if(linkedPair.getSource() instanceof TransformerArgument && linkedPair.getTarget() instanceof Record){
         TransformerArgument source = (TransformerArgument) linkedPair.getSource();
         Record target = (Record) linkedPair.getTarget();
        
         paramContext = new MappingElement();

         TextContext argumentText = TextContext.createInstance();
         argumentText.setText(target.getReferenceName());
         paramContext.setArgument(argumentText);
        
         ((MappingElement)paramContext).setKey(Record.KEY == target.getKeyType());
         //paramContext.setVariable(ProcessVariable.forName(source.getReferenceName()));
        
         if(target.getExtendedProperties()!=null && target.getExtendedProperties().containsKey("type")){
           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){
      
        
         Record source = (Record) linkedPair.getSource();
         Record target = (Record) linkedPair.getTarget();
        
         paramContext = new MappingElement();
         TextContext argumentText = TextContext.createInstance();
         argumentText.setText(target.getReferenceName());
         paramContext.setArgument(argumentText);
         paramContext.setVariable(ProcessVariable.forName(source.getReferenceName()));
         ((MappingElement)paramContext).setKey(Record.KEY == target.getKeyType());
        
         if(target.getExtendedProperties()!=null && target.getExtendedProperties().containsKey("type")){
           paramContext.setType((Class)target.getExtendedProperties().get("type"));
         }
View Full Code Here

           //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.
                 
                   /**
                    * transformer argument is eager to be changed since the user interface occasionally re-rendered.
                    */
                   priorTransformerArgument = priorTransformer.getTransferArgument(priorTransformerArgument.getName());
 
                   //the output argument of transformer must be the source which should be linked in the first order
                   TransformerArgument source = priorTransformerArgument;
                  
                  
                   try{
                     mapToolPanel.getModel().addLink(source, target);
                   }catch(Exception e){
View Full Code Here

TOP

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

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.