Below is the example of using the SetEtl operation for adding the Copy Data object to ETL task. The request contains moniker of opened ETL task instance and parameters of creating a new object: type of created object and its specific settings. The response contains updated information about ETL task objects.
{ "SetEtl" : { "tEtl" : { "id" : "S1!M!S!L1" }, "tArg" : { "pattern" : { "obInst" : "true", "objects" : "Add", "object" : { "settings" : "true" } }, "meta" : { "objects" : { "its" : { "it" : [ { "k" : "0", "id" : "COPY_TABLE", "vis" : "true", "type" : "PlainDataCopy", "settings" : { "plainDataCopy" : { "provider" : { "obDesc" : { "@isShortcut" : "false", "@isLink" : "false", "@hf" : "false", "i" : "DATA_INDICATORS", "n" : "Table", "k" : "37885", "c" : "769", "p" : "4294967295", "h" : "false" } }, "consumer" : { "obDesc" : { "@isShortcut" : "false", "@isLink" : "false", "@hf" : "false", "i" : "BACKUP_DATA", "n" : "Table", "k" : "37886", "c" : "769", "p" : "4294967295", "h" : "false" } }, "autoLink" : "true", "clearConsumer" : "true" } } } ] } } }, "metaGet" : { "obInst" : "true", "objects" : "Get" } } } }
{ "SetEtlResult" : { "id" : { "id" : "S1!M!S!L1" }, "meta" : { "obInst" : { "obDesc" : { "@fullUrl" : "\/", "@isShortcut" : "0", "@isLink" : "0", "i" : "ETL_INDICATOR", "n" : "ETL task for factor loading", "k" : "7012", "c" : "4097", "p" : "7011", "h" : "0", "isPermanent" : "1", "isTemp" : "0" } }, "dirty" : "1", "objects" : { "its" : { "it" : [ { "k" : "1", "id" : "PLAINDATAEXCELPROVIDER1", "n" : "Excel import (97-2003)1", "vis" : "1", "type" : "PlainDataExcelProvider", "settings" : "" }, { "k" : "3", "id" : "PLAINDATAMETABASECONSUMER1", "n" : "Repository consumer1", "vis" : "1", "type" : "PlainDataMetabaseConsumer", "settings" : "" }, { "k" : "5", "id" : "PLAINDATACOPY1", "n" : "Copy data1", "vis" : "1", "type" : "PlainDataCopy", "settings" : { "plainDataCopy" : { "provider" : "", "consumer" : { "obDesc" : { "@fullUrl" : "\/", "@isShortcut" : "0", "@isLink" : "0", "i" : "T_INDICATOR", "n" : "Table", "k" : "7013", "c" : "769", "p" : "7011", "h" : "0" }, "keyFieldNames" : "" }, "clearConsumer" : "1", "commitCount" : "1024", "actionOnProblem" : "DiscardInvalidRecords" } } }, { "k" : "7", "id" : "COPY_TABLE", "n" : "Copy data2", "vis" : "1", "type" : "PlainDataCopy", "settings" : { "plainDataCopy" : { "provider" : { "obDesc" : { "@fullUrl" : "\/", "@isShortcut" : "0", "@isLink" : "0", "i" : "DATA_INDICATORS", "n" : "Table", "k" : "37885", "c" : "769", "p" : "7011", "h" : "0" } }, "consumer" : { "obDesc" : { "@fullUrl" : "\/", "@isShortcut" : "0", "@isLink" : "0", "i" : "BACKUP_DATA", "n" : "Table", "k" : "37886", "c" : "769", "p" : "7011", "h" : "0" }, "keyFieldNames" : "" }, "clearConsumer" : "1", "commitCount" : "1024", "actionOnProblem" : "Abort" } } } ] } } } } }
public static SetEtlResult AddETLObject(MbId mb, EtlId moniker) { var somClient = new SomPortTypeClient(); //Proxy object for operation execution //Operation execution parameters var tSet = new SetEtl() { tArg = new SetEtlArg() { pattern = new EtlMdPattern() { objects = ListOperation.Add, @object = new EtlObjectPattern() { settings = true } },
meta = new EtlMd() { objects = new EtlObjects() { its = new EtlObject[] { new EtlObject() { //Basic properties id = "COPY_TABLE", k = 0,
type = EtlObjectType.PlainDataCopy, vis = true, //Set up data copy object settings = new EtlObjectSettings() {
plainDataCopy = new EtlPlainDataCopy() { autoLink = true, clearConsumer = true, //Provider
provider = new DtProvider() { obDesc = FindObjectById(mb, "DATA_INDICATORS") }, //Consumer consumer = new DtConsumer()
{ obDesc = FindObjectById(mb, "BACKUP_DATA") } }
} } } } }, metaGet = new EtlMdPattern() {
objects = ListOperation.Get } }, tEtl = moniker }; //Add object to ETL task var result = somClient.SetEtl(tSet); return result; }
See also: