package com.chenyang.nse.bussiness.engine.infa.powercenter961.subsetdata;

import com.chenyang.nse.bussiness.engine.infa.InfoProperty;
import com.chenyang.nse.bussiness.engine.infa.basic.xmlbean.CONFIG;
import com.chenyang.nse.bussiness.engine.infa.basic.xmlbean.FOLDER;
import com.chenyang.nse.bussiness.engine.infa.basic.xmlbean.MAPPING;
import com.chenyang.nse.bussiness.engine.infa.basic.xmlbean.MAPPLET;
import com.chenyang.nse.bussiness.engine.infa.basic.xmlbean.POWERMART;
import com.chenyang.nse.bussiness.engine.infa.basic.xmlbean.REPOSITORY;
import com.chenyang.nse.bussiness.engine.infa.basic.xmlbean.SOURCE;
import com.chenyang.nse.bussiness.engine.infa.basic.xmlbean.TARGET;
import com.chenyang.nse.bussiness.engine.infa.basic.xmlbean.WORKFLOW;
import com.chenyang.nse.bussiness.engine.infa.powercenter961.maskdata.Configutil;
import com.chenyang.nse.bussiness.engine.infa.powercenter961.maskdata.Folderutil;
import com.chenyang.nse.bussiness.engine.infa.powercenter961.maskdata.ParamBean;
import com.chenyang.nse.bussiness.engine.infa.powercenter961.maskdata.Powermartutil;
import com.chenyang.nse.bussiness.engine.infa.powercenter961.maskdata.Repositoryutil;
import com.chenyang.nse.bussiness.engine.infa.powercenter961.pubbean.CommonBean;
import com.chenyang.nse.bussiness.engine.infa.powercenter961.pubbean.MappingBean;
import com.chenyang.nse.bussiness.engine.infa.powercenter961.pubbean.MappletMakeDatabean;
import com.chenyang.nse.bussiness.engine.infa.powercenter961.pubbean.SourceBean;
import com.chenyang.nse.bussiness.engine.infa.powercenter961.pubbean.TargetBean;
import com.chenyang.nse.bussiness.engine.infa.powercenter961.pubbean.WorkflowBean;
import com.chenyang.nse.bussiness.engine.infa.powercenter961.pubtool.InfoExecUtil;
import com.chenyang.nse.bussiness.engine.infa.powercenter961.pubtool.ToObjutil;
import com.chenyang.nse.bussiness.tools.io.FileTool;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.List;

public class ChildMppletCollectiveUtil {
   public void childMethod(ParamBean par_bean, List<SourceBean> sb, List<TargetBean> tb, InfoProperty tengine) throws Exception {
      new POWERMART();
      POWERMART powermart = Powermartutil.getPowermart(par_bean);
      new REPOSITORY();
      REPOSITORY repository = Repositoryutil.getREPOSITORY(par_bean, tengine);
      new FOLDER();
      FOLDER folder = Folderutil.getFolder(par_bean);
      ChildMappletSourceUtil gsu = new ChildMappletSourceUtil();
      if (sb != null && sb.size() > 0) {
         new ArrayList();
         new ArrayList();
         List<SOURCE> gtu = gsu.getChildSource(sb);
         if (gtu != null && gtu.size() > 0) {
            for(int i = 0; i < gtu.size(); ++i) {
               folder.getFOLDERVERSIONOrCONFIGOrSCHEDULEROrTASKOrSESSIONOrWORKLETOrWORKFLOWOrSOURCEOrTARGETOrTRANSFORMATIONOrMAPPLETOrMAPPINGOrSHORTCUTOrEXPRMACRO().add(gtu.get(i));
            }
         }

         List<SOURCE> map = gsu.getSourceOther(sb);
         if (map != null && map.size() > 0) {
            for(int i = 0; i < map.size(); ++i) {
               folder.getFOLDERVERSIONOrCONFIGOrSCHEDULEROrTASKOrSESSIONOrWORKLETOrWORKFLOWOrSOURCEOrTARGETOrTRANSFORMATIONOrMAPPLETOrMAPPINGOrSHORTCUTOrEXPRMACRO().add(map.get(i));
            }
         }
      }

      ChildMappletTargetUtil gtu = new ChildMappletTargetUtil();
      if (tb != null && tb.size() > 0) {
         new ArrayList();
         new ArrayList();
         List<TARGET> var33 = gtu.getChildTarget(tb);
         List<TARGET> var36 = gtu.getTargetOther(tb);
         if (var33 != null && var33.size() > 0) {
            for(int i = 0; i < var33.size(); ++i) {
               folder.getFOLDERVERSIONOrCONFIGOrSCHEDULEROrTASKOrSESSIONOrWORKLETOrWORKFLOWOrSOURCEOrTARGETOrTRANSFORMATIONOrMAPPLETOrMAPPINGOrSHORTCUTOrEXPRMACRO().add(var33.get(i));
            }
         }

         if (var36 != null && var36.size() > 0) {
            for(int i = 0; i < var36.size(); ++i) {
               folder.getFOLDERVERSIONOrCONFIGOrSCHEDULEROrTASKOrSESSIONOrWORKLETOrWORKFLOWOrSOURCEOrTARGETOrTRANSFORMATIONOrMAPPLETOrMAPPINGOrSHORTCUTOrEXPRMACRO().add(var36.get(i));
            }
         }
      }

      List<MappletMakeDatabean> map = new ArrayList();
      List<String> maplist = new ArrayList();

      for(int k = 0; k < sb.size(); ++k) {
         FileTool.createFolder(tengine.getXmldir() + File.separator + "mapplet");
         if (k == 0) {
            if (((SourceBean)sb.get(k)).getMappletbean() != null && ((SourceBean)sb.get(k)).getMappletbean().size() > 0) {
               for(int i = 0; i < ((SourceBean)sb.get(k)).getMappletbean().size(); ++i) {
                  if (i == 0) {
                     map.add(((SourceBean)sb.get(k)).getMappletbean().get(i));
                     maplist.add(((MappletMakeDatabean)((SourceBean)sb.get(k)).getMappletbean().get(i)).getMappletname());
                  } else if (!maplist.contains(((MappletMakeDatabean)((SourceBean)sb.get(k)).getMappletbean().get(i)).getMappletname())) {
                     map.add(((SourceBean)sb.get(k)).getMappletbean().get(i));
                     maplist.add(((MappletMakeDatabean)((SourceBean)sb.get(k)).getMappletbean().get(i)).getMappletname());
                  }
               }
            }
         } else if (((SourceBean)sb.get(k)).getMappletbean() != null && ((SourceBean)sb.get(k)).getMappletbean().size() > 0) {
            for(int i = 0; i < ((SourceBean)sb.get(k)).getMappletbean().size(); ++i) {
               if (!maplist.contains(((MappletMakeDatabean)((SourceBean)sb.get(k)).getMappletbean().get(i)).getMappletname())) {
                  map.add(((SourceBean)sb.get(k)).getMappletbean().get(i));
                  maplist.add(((MappletMakeDatabean)((SourceBean)sb.get(k)).getMappletbean().get(i)).getMappletname());
               }
            }
         }
      }

      if (map != null && map.size() > 0) {
         for(int i = 0; i < map.size(); ++i) {
            try {
               InfoExecUtil.exeobjectexportmapplet(tengine.getPmrepexepath(), "cs_mapplet", ((MappletMakeDatabean)map.get(i)).getMappletname(), tengine.getXmldir() + File.separator + "cs_mapplet" + File.separator + ((MappletMakeDatabean)map.get(i)).getMappletname());
               InputStream is = new FileInputStream(tengine.getXmldir() + File.separator + "cs_mapplet" + File.separator + ((MappletMakeDatabean)map.get(i)).getMappletname() + ".xml");
               ToObjutil to = new ToObjutil();
               BufferedReader tBufferedReader = new BufferedReader(new InputStreamReader(is, "UTF-8"));
               int w = 0;
               StringBuffer tStringBuffer = new StringBuffer();
               new String("");

               String alllist;
               while((alllist = tBufferedReader.readLine()) != null) {
                  ++w;
                  if (w == 2) {
                     tStringBuffer.append("");
                  } else {
                     tStringBuffer.append(alllist);
                  }
               }

               Object obj = ToObjutil.unmarshalmo("com.chenyang.nse.bussiness.engine.infa.basic.xmlbean", tStringBuffer.toString());
               POWERMART power = (POWERMART)obj;
               List<REPOSITORY> repositorListWf = power.getREPOSITORY();
               new MAPPLET();

               for(int l = 0; l < repositorListWf.size(); ++l) {
                  REPOSITORY repositor = (REPOSITORY)repositorListWf.get(l);
                  List<FOLDER> folderList = repositor.getFOLDER();

                  for(int j = 0; j < folderList.size(); ++j) {
                     FOLDER folder1 = (FOLDER)folderList.get(j);

                     for(Object object1 : folder1.getFOLDERVERSIONOrCONFIGOrSCHEDULEROrTASKOrSESSIONOrWORKLETOrWORKFLOWOrSOURCEOrTARGETOrTRANSFORMATIONOrMAPPLETOrMAPPINGOrSHORTCUTOrEXPRMACRO()) {
                        if (object1.getClass().getName().equals("com.chenyang.nse.bussiness.engine.infa.basic.xmlbean.MAPPLET")) {
                           MAPPLET mapp = (MAPPLET)object1;
                           folder.getFOLDERVERSIONOrCONFIGOrSCHEDULEROrTASKOrSESSIONOrWORKLETOrWORKFLOWOrSOURCEOrTARGETOrTRANSFORMATIONOrMAPPLETOrMAPPINGOrSHORTCUTOrEXPRMACRO().add(mapp);
                        }
                     }
                  }
               }
            } catch (Exception e) {
               e.printStackTrace();
            }
         }
      }

      List<MappingBean> mb = new ArrayList();

      for(int i = 0; i < sb.size(); ++i) {
         MappingBean map_bean = new MappingBean();
         map_bean.setMapping_name("mp_" + ((SourceBean)sb.get(i)).getSo_name());
         map_bean.setSq_name("SQ_" + ((SourceBean)sb.get(i)).getSo_name());
         map_bean.setSource_name(((SourceBean)sb.get(i)).getSo_name());
         map_bean.setTarget_name(((TargetBean)tb.get(i)).getTar_name());
         map_bean.setSourcedbname(((SourceBean)sb.get(i)).getDbdname());
         map_bean.setMappletbean(((SourceBean)sb.get(i)).getMappletbean());
         CommonBean cblist = ((SourceBean)sb.get(i)).getCb();
         List<String> map_typeList = new ArrayList();
         List<String> map_precisionList = new ArrayList();
         List<String> map_scaleList = new ArrayList();
         if ("DB2".equals(((SourceBean)sb.get(i)).getDatabasetype())) {
            for(int j = 0; j < cblist.getTypeList().size(); ++j) {
               if ("character".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("string");
                  map_precisionList.add(cblist.getPrecisionList().get(j));
                  map_scaleList.add(cblist.getScalelist().get(j));
               } else if ("varchar".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("string");
                  map_precisionList.add(cblist.getPrecisionList().get(j));
                  map_scaleList.add(cblist.getScalelist().get(j));
               } else if ("char".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("string");
                  map_precisionList.add(cblist.getPrecisionList().get(j));
                  map_scaleList.add(cblist.getScalelist().get(j));
               } else if ("date".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("date/time");
                  map_precisionList.add("29");
                  map_scaleList.add("9");
               } else if ("time".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("date/time");
                  map_precisionList.add("29");
                  map_scaleList.add("9");
               } else if ("timestamp".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("date/time");
                  map_precisionList.add("29");
                  map_scaleList.add("9");
               } else if ("clob".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("text");
                  map_precisionList.add(cblist.getPrecisionList().get(j));
                  map_scaleList.add("0");
               } else if ("blob".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("binary");
                  map_precisionList.add(cblist.getPrecisionList().get(j));
                  map_scaleList.add("0");
               } else if ("smallint".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("small integer");
                  map_precisionList.add(cblist.getPrecisionList().get(j));
                  map_scaleList.add("0");
               } else {
                  map_typeList.add(((String)cblist.getTypeList().get(j)).toLowerCase());
                  map_precisionList.add(cblist.getPrecisionList().get(j));
                  map_scaleList.add(cblist.getScalelist().get(j));
               }
            }
         } else if ("ORACLE".equals(((SourceBean)sb.get(i)).getDatabasetype())) {
            for(int j = 0; j < cblist.getTypeList().size(); ++j) {
               if ("TIMESTAMP(6)".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("date/time");
                  map_precisionList.add("29");
                  map_scaleList.add("9");
               } else if ("NUMBER".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("double");
                  map_precisionList.add("15");
                  map_scaleList.add("15");
               } else if ("DATE".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("date/time");
                  map_precisionList.add("29");
                  map_scaleList.add("9");
               } else if ("VARBINARY".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("binary");
                  map_precisionList.add(cblist.getPrecisionList().get(j));
                  map_scaleList.add(cblist.getScalelist().get(j));
               } else if ("BIGINT".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("double");
                  map_precisionList.add(cblist.getPrecisionList().get(j));
                  map_scaleList.add(cblist.getScalelist().get(j));
               } else if ("TIME".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("date/time");
                  map_precisionList.add("29");
                  map_scaleList.add("9");
               } else if ("NUMERIC".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("double");
                  map_precisionList.add(cblist.getPrecisionList().get(j));
                  map_scaleList.add(cblist.getScalelist().get(j));
               } else if ("CHAR".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("string");
                  map_precisionList.add(cblist.getPrecisionList().get(j));
                  map_scaleList.add(cblist.getScalelist().get(j));
               } else if ("BIT".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("double");
                  map_precisionList.add(cblist.getPrecisionList().get(j));
                  map_scaleList.add(cblist.getScalelist().get(j));
               } else if ("SMALLINT".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("double");
                  map_precisionList.add(cblist.getPrecisionList().get(j));
                  map_scaleList.add(cblist.getScalelist().get(j));
               } else if ("BLOB".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("binary");
                  map_precisionList.add(cblist.getPrecisionList().get(j));
                  map_scaleList.add(cblist.getScalelist().get(j));
               } else if ("VARCHAR".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("string");
                  map_precisionList.add(cblist.getPrecisionList().get(j));
                  map_scaleList.add(cblist.getScalelist().get(j));
               } else if ("DECIMAL".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("decimal");
                  map_precisionList.add(cblist.getPrecisionList().get(j));
                  map_scaleList.add(cblist.getScalelist().get(j));
               } else if ("CLOB".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("text");
                  map_precisionList.add(cblist.getPrecisionList().get(j));
                  map_scaleList.add(cblist.getScalelist().get(j));
               } else if ("REAL".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("double");
                  map_precisionList.add(cblist.getPrecisionList().get(j));
                  map_scaleList.add(cblist.getScalelist().get(j));
               } else if ("NCHAR".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("string");
                  map_precisionList.add(cblist.getPrecisionList().get(j));
                  map_scaleList.add(cblist.getScalelist().get(j));
               } else if ("NCLOB".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("string");
                  map_precisionList.add(cblist.getPrecisionList().get(j));
                  map_scaleList.add(cblist.getScalelist().get(j));
               } else if ("FLOAT".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("double");
                  map_precisionList.add(cblist.getPrecisionList().get(j));
                  map_scaleList.add(cblist.getScalelist().get(j));
               } else if ("LONGVARCHAR".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("text");
                  map_precisionList.add(cblist.getPrecisionList().get(j));
                  map_scaleList.add(cblist.getScalelist().get(i));
               } else if ("TINYINT".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("double");
                  map_precisionList.add(cblist.getPrecisionList().get(j));
                  map_scaleList.add(cblist.getScalelist().get(j));
               } else if ("INTEGER".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("double");
                  map_precisionList.add(cblist.getPrecisionList().get(j));
                  map_scaleList.add(cblist.getScalelist().get(j));
               } else if ("NVARCHAR".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("string");
                  map_precisionList.add(cblist.getPrecisionList().get(j));
                  map_scaleList.add(cblist.getScalelist().get(j));
               } else if ("VARCHAR2".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("string");
                  map_precisionList.add(cblist.getPrecisionList().get(j));
                  map_scaleList.add(cblist.getScalelist().get(j));
               } else if ("LONG".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("text");
                  map_precisionList.add("4000");
                  map_scaleList.add("0");
               } else {
                  map_typeList.add(((String)cblist.getTypeList().get(j)).toLowerCase());
                  map_precisionList.add(cblist.getPrecisionList().get(j));
                  map_scaleList.add(cblist.getScalelist().get(j));
               }
            }
         } else if ("INFORMIX".equals(((SourceBean)sb.get(i)).getDatabasetype())) {
            for(int j = 0; j < cblist.getTypeList().size(); ++j) {
               if ("varchar".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("string");
                  map_precisionList.add(cblist.getPrecisionList().get(j));
                  map_scaleList.add(cblist.getScalelist().get(j));
               } else if ("blob".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("binary");
                  map_precisionList.add("4000");
                  map_scaleList.add("0");
               } else if ("boolean".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("small integer");
                  map_precisionList.add("5");
                  map_scaleList.add("0");
               } else if ("byte".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("binary");
                  map_precisionList.add("29");
                  map_scaleList.add("0");
               } else if ("char".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("string");
                  map_precisionList.add(cblist.getPrecisionList().get(j));
                  map_scaleList.add(cblist.getScalelist().get(i));
               } else if ("clob".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("text");
                  map_precisionList.add("4000");
                  map_scaleList.add("0");
               } else if ("date".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("date/time");
                  map_precisionList.add("29");
                  map_scaleList.add("9");
               } else if ("datetime".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("date/time");
                  map_precisionList.add("29");
                  map_scaleList.add("9");
               } else if ("float".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("double");
                  map_precisionList.add("15");
                  map_scaleList.add("0");
               } else if ("int8".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("bigint");
                  map_precisionList.add("19");
                  map_scaleList.add("0");
               } else if ("int".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("integer");
                  map_precisionList.add("10");
                  map_scaleList.add("0");
               } else if ("lvarchar".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("string");
                  map_precisionList.add(cblist.getPrecisionList().get(j));
                  map_scaleList.add(cblist.getScalelist().get(j));
               } else if ("money".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("decimal");
                  map_precisionList.add("16");
                  map_scaleList.add("2");
               } else if ("nchar".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("string");
                  map_precisionList.add(cblist.getPrecisionList().get(j));
                  map_scaleList.add(cblist.getScalelist().get(j));
               } else if ("nvarchar".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("nstring");
                  map_precisionList.add(cblist.getPrecisionList().get(j));
                  map_scaleList.add(cblist.getScalelist().get(j));
               } else if ("serial".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("integer");
                  map_precisionList.add("10");
                  map_scaleList.add("0");
               } else if ("serial8".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("bigint");
                  map_precisionList.add("19");
                  map_scaleList.add("0");
               } else if ("smallfloat".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("real");
                  map_precisionList.add("7");
                  map_scaleList.add("0");
               } else if ("smallint".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("small integer");
                  map_precisionList.add("5");
                  map_scaleList.add("0");
               } else if ("varchar".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("string");
                  map_precisionList.add(cblist.getPrecisionList().get(j));
                  map_scaleList.add(cblist.getScalelist().get(j));
               } else if ("decimal".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("decimal");
                  map_precisionList.add(cblist.getPrecisionList().get(j));
                  map_scaleList.add(cblist.getScalelist().get(j));
               } else {
                  map_typeList.add(((String)cblist.getTypeList().get(j)).toLowerCase());
                  map_precisionList.add(cblist.getPrecisionList().get(j));
                  map_scaleList.add(cblist.getScalelist().get(j));
               }
            }
         } else if ("MSSQLSERVER".equals(((SourceBean)sb.get(i)).getDatabasetype())) {
            for(int j = 0; j < cblist.getTypeList().size(); ++j) {
               if ("bigint".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("bigint");
                  map_precisionList.add("19");
                  map_scaleList.add(cblist.getScalelist().get(j));
               } else if ("binary".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("binary");
                  map_precisionList.add(cblist.getPrecisionList().get(j));
                  map_scaleList.add("0");
               } else if ("bit".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("string");
                  map_precisionList.add("1");
                  map_scaleList.add("0");
               } else if ("char".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("string");
                  map_precisionList.add(cblist.getPrecisionList().get(j));
                  map_scaleList.add("0");
               } else if ("date".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("date/time");
                  map_precisionList.add("29");
                  map_scaleList.add("9");
               } else if ("datetime".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("date/time");
                  map_precisionList.add("29");
                  map_scaleList.add("9");
               } else if ("datetime2".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("date/time");
                  map_precisionList.add("29");
                  map_scaleList.add("9");
               } else if ("datetimeoffset".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("nstring");
                  map_precisionList.add("34");
                  map_scaleList.add("0");
               } else if ("decimal".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("decimal");
                  map_precisionList.add(cblist.getPrecisionList().get(j));
                  map_scaleList.add("0");
               } else if ("real".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("real");
                  map_precisionList.add("7");
                  map_scaleList.add("0");
               } else if ("geography".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("string");
                  map_precisionList.add(cblist.getPrecisionList().get(j));
                  map_scaleList.add(cblist.getScalelist().get(j));
               } else if ("geometry".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("string");
                  map_precisionList.add(cblist.getPrecisionList().get(j));
                  map_scaleList.add(cblist.getScalelist().get(j));
               } else if ("hierarchyid".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("string");
                  map_precisionList.add("892");
                  map_scaleList.add("0");
               } else if ("image".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("binary");
                  map_precisionList.add("4000");
                  map_scaleList.add("0");
               } else if ("int".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("integer");
                  map_precisionList.add("10");
                  map_scaleList.add(cblist.getScalelist().get(j));
               } else if ("money".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("decimal");
                  map_precisionList.add("19");
                  map_scaleList.add("4");
               } else if ("nchar".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
                  map_typeList.add("nstring");
                  map_precisionList.add(cblist.getPrecisionList().get(j));
                  map_scaleList.add(cblist.getScalelist().get(i));
               } else if ("ntext".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("ntext");
                  map_precisionList.add("104857600");
                  map_scaleList.add("0");
               } else if ("numeric".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("decimal");
                  map_precisionList.add(cblist.getPrecisionList().get(j));
                  map_scaleList.add(cblist.getScalelist().get(j));
               } else if ("nvarchar".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("nstring");
                  map_precisionList.add(cblist.getPrecisionList().get(j));
                  map_scaleList.add(cblist.getScalelist().get(i));
               } else if ("real".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("real");
                  map_precisionList.add("7");
                  map_scaleList.add("0");
               } else if ("smalldatetime".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("date/time");
                  map_precisionList.add("29");
                  map_scaleList.add("9");
               } else if ("smallint".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("small integer");
                  map_precisionList.add("5");
                  map_scaleList.add("0");
               } else if ("smallmoney".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("decimal");
                  map_precisionList.add("10");
                  map_scaleList.add("4");
               } else if ("sql_variant".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("string");
                  map_precisionList.add("8000");
                  map_scaleList.add("4");
               } else if ("sysname".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("nstring");
                  map_precisionList.add("128");
                  map_scaleList.add("4");
               } else if ("text".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("text");
                  map_precisionList.add("4000");
                  map_scaleList.add("0");
               } else if ("time".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("date/time");
                  map_precisionList.add("29");
                  map_scaleList.add("9");
               } else if ("timestamp".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("binary");
                  map_precisionList.add("8");
                  map_scaleList.add("0");
               } else if ("tinyint".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("small integer");
                  map_precisionList.add("5");
                  map_scaleList.add("0");
               } else if ("uniqueidentifier".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("string");
                  map_precisionList.add("38");
                  map_scaleList.add("0");
               } else if ("varbinary".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("binary");
                  map_precisionList.add(cblist.getPrecisionList().get(j));
                  map_scaleList.add("0");
               } else if ("varchar".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("string");
                  map_precisionList.add(cblist.getPrecisionList().get(j));
                  map_scaleList.add("0");
               } else {
                  map_typeList.add(((String)cblist.getTypeList().get(j)).toLowerCase());
                  map_precisionList.add(cblist.getPrecisionList().get(j));
                  map_scaleList.add(cblist.getScalelist().get(j));
               }
            }
         } else if ("MYSQL".equals(((SourceBean)sb.get(i)).getDatabasetype())) {
            for(int j = 0; j < cblist.getTypeList().size(); ++j) {
               if ("TINYINT".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("small integer");
                  map_precisionList.add("5");
                  map_scaleList.add("0");
               } else if ("SMALLINT".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("small integer");
                  map_precisionList.add("5");
                  map_scaleList.add("0");
               } else if ("MEDIUMINT".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("integer");
                  map_precisionList.add(cblist.getPrecisionList().get(j));
                  map_scaleList.add("0");
               } else if ("INT".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("integer");
                  map_precisionList.add(cblist.getPrecisionList().get(j));
                  map_scaleList.add("0");
               } else if ("BIGINT".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("bigint");
                  map_precisionList.add(cblist.getPrecisionList().get(j));
                  map_scaleList.add("0");
               } else if ("BIT".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("string");
                  map_precisionList.add(cblist.getPrecisionList().get(j));
                  map_scaleList.add("0");
               } else if ("DOUBLE".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("double");
                  map_precisionList.add("25");
                  map_scaleList.add("0");
               } else if ("FLOAT".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("real");
                  map_precisionList.add("255");
                  map_scaleList.add("0");
               } else if ("DECIMAL".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("decimal");
                  map_precisionList.add("65");
                  map_scaleList.add("0");
               } else if ("CHAR".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("nstring");
                  map_precisionList.add("255");
                  map_scaleList.add("0");
               } else if ("VARCHAR".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("nstring");
                  map_precisionList.add(cblist.getPrecisionList().get(j));
                  map_scaleList.add("0");
               } else if ("DATE".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("date/time");
                  map_precisionList.add("29");
                  map_scaleList.add("9");
               } else if ("TIME".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("date/time");
                  map_precisionList.add("29");
                  map_scaleList.add("9");
               } else if ("YEAR".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("small integer");
                  map_precisionList.add("5");
                  map_scaleList.add("0");
               } else if ("TIMESTAMP".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("date/time");
                  map_precisionList.add("29");
                  map_scaleList.add("9");
               } else if ("DATETIME".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("date/time");
                  map_precisionList.add("29");
                  map_scaleList.add("9");
               } else if ("TINYBLOB".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("binary");
                  map_precisionList.add("255");
                  map_scaleList.add("0");
               } else if ("BLOB".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("binary");
                  map_precisionList.add("65535");
                  map_scaleList.add("0");
               } else if ("MEDIUMBLOB".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("binary");
                  map_precisionList.add("16777215");
                  map_scaleList.add("0");
               } else if ("LONGBLOB".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("binary");
                  map_precisionList.add("-1");
                  map_scaleList.add("0");
               } else if ("TINYTEXT".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("ntext");
                  map_precisionList.add("255");
                  map_scaleList.add("0");
               } else if ("TEXT".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("ntext");
                  map_precisionList.add("65535");
                  map_scaleList.add("9");
               } else if ("MEDIUMTEXT".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("ntext");
                  map_precisionList.add("16777215");
                  map_scaleList.add("0");
               } else if ("LONGTEXT".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("ntext");
                  map_precisionList.add("-1");
                  map_scaleList.add("0");
               } else if ("ENUM".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("nstring");
                  map_precisionList.add("0");
                  map_scaleList.add("0");
               } else if ("SET".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("nstring");
                  map_precisionList.add("0");
                  map_scaleList.add("0");
               } else if ("BINARY".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("binary");
                  map_precisionList.add("255");
                  map_scaleList.add("0");
               } else if ("VARBINARY".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("binary");
                  map_precisionList.add("255");
                  map_scaleList.add("0");
               } else if ("POINT".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("binary");
                  map_precisionList.add("-1");
                  map_scaleList.add("0");
               } else if ("LINESTRING".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("binary");
                  map_precisionList.add("-1");
                  map_scaleList.add("0");
               } else if ("POLYGON".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("binary");
                  map_precisionList.add("-1");
                  map_scaleList.add("0");
               } else if ("GEOMETRY".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("binary");
                  map_precisionList.add("-1");
                  map_scaleList.add("0");
               } else if ("MULTIPOINT".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("binary");
                  map_precisionList.add("-1");
                  map_scaleList.add("0");
               } else if ("MULTILINESTRING".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("binary");
                  map_precisionList.add("-1");
                  map_scaleList.add("0");
               } else if ("MULTIPOLYGON".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("binary");
                  map_precisionList.add("-1");
                  map_scaleList.add("0");
               } else if ("GEOMETRYCOLLECTION".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("binary");
                  map_precisionList.add("-1");
                  map_scaleList.add("0");
               } else {
                  map_typeList.add(((String)cblist.getTypeList().get(j)).toLowerCase());
                  map_precisionList.add(cblist.getPrecisionList().get(j));
                  map_scaleList.add(cblist.getScalelist().get(j));
               }
            }
         } else if ("SYBASE".equals(((SourceBean)sb.get(i)).getDatabasetype())) {
            for(int j = 0; j < cblist.getTypeList().size(); ++j) {
               if ("bigint".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("bigint");
                  map_precisionList.add(cblist.getPrecisionList().get(j));
                  map_scaleList.add("0");
               } else if ("binary".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("binary");
                  map_precisionList.add(cblist.getPrecisionList().get(j));
                  map_scaleList.add("0");
               } else if ("bit".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("string");
                  map_precisionList.add(cblist.getPrecisionList().get(j));
                  map_scaleList.add("0");
               } else if ("char".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("string");
                  map_precisionList.add(cblist.getPrecisionList().get(j));
                  map_scaleList.add("0");
               } else if ("date".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("date/time");
                  map_precisionList.add("29");
                  map_scaleList.add("9");
               } else if ("datetime".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("date/time");
                  map_precisionList.add("29");
                  map_scaleList.add("9");
               } else if ("decimal".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("decimal");
                  map_precisionList.add(cblist.getPrecisionList().get(j));
                  map_scaleList.add(cblist.getScalelist().get(j));
               } else if ("float".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("double");
                  map_precisionList.add(cblist.getPrecisionList().get(j));
                  map_scaleList.add(cblist.getScalelist().get(j));
               } else if ("image".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("binary");
                  map_precisionList.add("4000");
                  map_scaleList.add("0");
               } else if ("int".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("integer");
                  map_precisionList.add(cblist.getPrecisionList().get(j));
                  map_scaleList.add("0");
               } else if ("varchar".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("string");
                  map_precisionList.add("255");
                  map_scaleList.add("0");
               } else if ("nchar".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
                  map_typeList.add("nstring");
                  map_precisionList.add(cblist.getPrecisionList().get(i));
                  map_scaleList.add("0");
               } else if ("nvarchar".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
                  map_typeList.add("nstring");
                  map_precisionList.add(cblist.getPrecisionList().get(i));
                  map_scaleList.add("0");
               } else if ("money".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("decimal");
                  map_precisionList.add("19");
                  map_scaleList.add("4");
               } else if ("real".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("real");
                  map_precisionList.add("7");
                  map_scaleList.add("0");
               } else if ("smalldatetime".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("date/time");
                  map_precisionList.add("29");
                  map_scaleList.add("9");
               } else if ("smallint".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("small integer");
                  map_precisionList.add("5");
                  map_scaleList.add("0");
               } else if ("sysname".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
                  map_typeList.add("string");
                  map_precisionList.add("100");
                  map_scaleList.add("0");
               } else if ("longsysname".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
                  map_typeList.add("string");
                  map_precisionList.add("255");
                  map_scaleList.add("0");
               } else if ("timestamp".equalsIgnoreCase((String)cblist.getTypeList().get(i))) {
                  map_typeList.add("binary");
                  map_precisionList.add("8");
                  map_scaleList.add("0");
               } else if ("smallmoney".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("decimal");
                  map_precisionList.add("10");
                  map_scaleList.add("4");
               } else if ("text".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("text");
                  map_precisionList.add("4000");
                  map_scaleList.add("0");
               } else if ("time".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("date/time");
                  map_precisionList.add("29");
                  map_scaleList.add("9");
               } else if ("varbinary".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("binary");
                  map_precisionList.add(cblist.getPrecisionList().get(j));
                  map_scaleList.add(cblist.getScalelist().get(i));
               } else if ("tinyint".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("small integer");
                  map_precisionList.add("5");
                  map_scaleList.add("0");
               } else if ("unichar".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("nstring");
                  map_precisionList.add("200");
                  map_scaleList.add("0");
               } else if ("unitext".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("nstring");
                  map_precisionList.add("4000");
                  map_scaleList.add("9");
               } else if ("univarchar".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("nstring");
                  map_precisionList.add("200");
                  map_scaleList.add("0");
               } else if ("unsigned bigint".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("bigint");
                  map_precisionList.add("19");
                  map_scaleList.add("0");
               } else if ("unsigned int".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("integer");
                  map_precisionList.add("10");
                  map_scaleList.add("0");
               } else if ("unsigned smallint".equalsIgnoreCase((String)cblist.getTypeList().get(j))) {
                  map_typeList.add("small integer");
                  map_precisionList.add("5");
                  map_scaleList.add("0");
               } else {
                  map_typeList.add(((String)cblist.getTypeList().get(j)).toLowerCase());
                  map_precisionList.add(cblist.getPrecisionList().get(j));
                  map_scaleList.add(cblist.getScalelist().get(j));
               }
            }
         }

         cblist.setMappingLengthList(map_precisionList);
         cblist.setMappingTypeList(map_typeList);
         cblist.setMappingScalelist(map_scaleList);
         map_bean.setCb(cblist);
         mb.add(map_bean);
      }

      ChildMappletMappingUtil mgu = new ChildMappletMappingUtil();
      if (mb != null && mb.size() > 0) {
         new MAPPING();
         MAPPING var47 = mgu.getChildMapping("mp_" + par_bean.getTaskname(), mb, par_bean);
         folder.getFOLDERVERSIONOrCONFIGOrSCHEDULEROrTASKOrSESSIONOrWORKLETOrWORKFLOWOrSOURCEOrTARGETOrTRANSFORMATIONOrMAPPLETOrMAPPINGOrSHORTCUTOrEXPRMACRO().add(var47);
      }

      new CONFIG();
      Configutil cu = new Configutil();
      CONFIG var48 = Configutil.getConfig();
      folder.getFOLDERVERSIONOrCONFIGOrSCHEDULEROrTASKOrSESSIONOrWORKLETOrWORKFLOWOrSOURCEOrTARGETOrTRANSFORMATIONOrMAPPLETOrMAPPINGOrSHORTCUTOrEXPRMACRO().add(var48);
      ChildMappletWorkflowUtil gwf = new ChildMappletWorkflowUtil();
      List<WorkflowBean> wb = new ArrayList();

      for(int i = 0; i < sb.size(); ++i) {
         WorkflowBean work_bean = new WorkflowBean();
         work_bean.setSourcename(((SourceBean)sb.get(i)).getSo_name());
         work_bean.setTargetname(((TargetBean)tb.get(i)).getTar_name());
         work_bean.setSqname(((MappingBean)mb.get(i)).getSq_name());
         work_bean.setTargetdbname(((TargetBean)tb.get(i)).getDbdname());
         work_bean.setSourcedbname(((SourceBean)sb.get(i)).getDbdname());
         work_bean.setSourceownername(((SourceBean)sb.get(i)).getSourceownername());
         work_bean.setTargetownername(((TargetBean)tb.get(i)).getTargetownername());
         work_bean.setMappletbean(((SourceBean)sb.get(i)).getMappletbean());
         work_bean.setSou_linkname(((SourceBean)sb.get(i)).getLinkname());
         work_bean.setTar_linkname(((TargetBean)tb.get(i)).getLinkname());
         work_bean.setSource_dbtype(((SourceBean)sb.get(i)).getDatabasetype());
         work_bean.setTarget_dbtype(((TargetBean)tb.get(i)).getDatabasetype());
         work_bean.setMainTable(((SourceBean)sb.get(i)).getMainTable());
         wb.add(work_bean);
      }

      if (wb != null && wb.size() > 0) {
         new WORKFLOW();
         WORKFLOW var57 = gwf.getChildGroupWorkflow("mp_" + par_bean.getTaskname(), "wf_" + par_bean.getTaskname(), tengine.getInteservicename(), tengine.getDomainname(), wb, par_bean.getParam_path(), tengine);
         folder.getFOLDERVERSIONOrCONFIGOrSCHEDULEROrTASKOrSESSIONOrWORKLETOrWORKFLOWOrSOURCEOrTARGETOrTRANSFORMATIONOrMAPPLETOrMAPPINGOrSHORTCUTOrEXPRMACRO().add(var57);
      }

      repository.getFOLDER().add(folder);
      powermart.getREPOSITORY().add(repository);
      List<Object> alllist = new ArrayList();
      alllist.add(powermart);
      OutputStream f = null;
      FileTool.createFolder(tengine.getXmldir() + File.separator + par_bean.getTaskname());
      OutputStream var67 = new FileOutputStream(tengine.getXmldir() + File.separator + par_bean.getTaskname() + File.separator + par_bean.getTaskname() + ".xml");
      ToObjutil.marshalmapplet("com.chenyang.nse.bussiness.engine.infa.basic.xmlbean", alllist, var67, "");
   }
}
