尽管我尝试将批处理作业组件与批处理步骤和批处理聚合器一起使用,但由于参数错误而导致无法调用函数map
的任何重载。在转换消息组件中附加了流程的屏幕截图和代码。
下面是转换消息组件的代码
%dw 2.0
output application/xml
---
{
Locations: {
(payload map ((payload01 , indexOfPayload01) -> {
location :{
documentStatusCode : "ORIGINAL", //Hardcode Value
documentActionCode : "ADD"
},
BasicLocation: {
ORG_LVL_CHILD : payload01.ORG_LVL_CHILD default "null" ,
ORG_LVL_CHILD_S : payload01.ORG_LVL_CHILD_S default "null" ,
ISS_TECH_KEY : payload01.ISS_TECH_KEY default "null" ,
TRAN_TYPE : payload01.TRAN_TYPE default "null" ,
AUDIT_NUMBER : payload01.AUDIT_NUMBER default "null" ,
ORG_LVL_PARENT : payload01.ORG_LVL_PARENT default "null" ,
ORG_NAME_FULL : payload01.ORG_NAME_FULL default "null" ,
ORG_NAME_SHORT : payload01.ORG_NAME_SHORT default "null" ,
ORG_LVL_NUMBER : payload01.ORG_LVL_NUMBER default "null" ,
CURR_CODE : payload01.CURR_CODE default "null" ,
ORG_IS_STORE : if ( payload01.ORG_IS_STORE == 'T') "Store" else "DC" ,
DATE_CREATED : payload01.DATE_CREATED default "null" ,
DOWNLOAD_DATE_1 : payload01.DOWNLOAD_DATE_1 default "null" ,
DOWNLOAD_DATE_2 : payload01.DOWNLOAD_DATE_2 default "null" ,
ORG_CLOSED_FR_DATE : payload01.ORG_CLOSED_FR_DATE default "null" ,
ORG_CLOSED_TO_DATE : payload01.ORG_CLOSED_TO_DATE default "null" ,
ORG_COMP_CLOSED : payload01.ORG_COMP_CLOSED default "null" ,
ORG_LVL_NUMBER_S : payload01.ORG_LVL_NUMBER_S default "null" ,
ORG_MANAGER_NAME : payload01.ORG_MANAGER_NAME default "null" ,
OLD_ORG_LVL_PARENT : payload01.OLD_ORG_LVL_PARENT default "null" ,
ORG_LVL_NUMBER_OLD_S : payload01.ORG_LVL_NUMBER_OLD_S default "null" ,
ORG_LVL_PARENT_NUM_OLD_S : payload01.ORG_LVL_PARENT_NUM_OLD_S default "null" ,
ORG_LVL_PARENT_NUM_S : payload01.ORG_LVL_PARENT_NUM_S default "null" ,
ORG_TYPE_CODE : payload01.ORG_TYPE_CODE default "null" ,
ORG_AR_NUM : payload01.ORG_AR_NUM default "null" ,
PRC_BOOK_NUMBER : payload01.PRC_BOOK_NUMBER default "null" ,
ORG_FRN_CODE : payload01.ORG_FRN_CODE default "null" ,
ORG_LVL_ID_S : payload01.ORG_LVL_ID_S default "null" ,
SYSTEM_OF_MEASURE : payload01.SYSTEM_OF_MEASURE default "null" ,
GLN_TYPE_CODE : payload01.GLN_TYPE_CODE default "null" ,
GLOBAL_LOCATION_NUMBER : payload01.GLOBAL_LOCATION_NUMBER default "null" ,
ALT_TECH_KEY : payload01.ALT_TECH_KEY default "null" ,
ORG_DATE_OPENED : payload01.ORG_DATE_OPENED default "null" ,
ORG_DATE_COMP : payload01.ORG_DATE_COMP default "null" ,
ORG_DATE_DISTR : payload01.ORG_DATE_DISTR default "null" ,
ORG_DATE_CLOSED : payload01.ORG_DATE_CLOSED default "null" ,
Address:{
CNTRY_CODE : payload01.CNTRY_CODE default "null" ,
BAS_STATE : payload01.BAS_STATE default "null" ,
BAS_CITY : payload01.BAS_CITY default "null" ,
BAS_ZIP : payload01.BAS_ZIP default "null" ,
BAS_ADDR_1 : payload01.BAS_ADDR_1 default "null" ,
BAS_ADDR_2 : payload01.BAS_ADDR_2 default "null" ,
BAS_ADDR_3 : payload01.BAS_ADDR_3 default "null"
},
Contact :{
CommunicationChannel :{
communticationChannelCode :"TELEPHONE",
communicationValue : payload01.BAS_PHONE_NUMB default ""
},
CommunicationChannel :{
communicationChannelCode :"TELEFAX",
communicationValue : payload01.BAS_FAX_NUMBER default ""
}
}
}
} ))
}
}
---------------------------------------------------------------------------------------------------------
The error thrown....
Unable to call any overload of function `map` with arguments
({|ORG_LVL_CHILD: Number, ORG_LVL_CHILD_S: Number, ISS_TECH_KEY:
Number, TRAN_TYPE: String, AUDIT_NUMBER: Number, ORG_LVL_PARENT?:
Number, ORG_NAME_FULL?: String, ORG_NAME_SHORT?: String, ORG_LVL_NUMBER?:
Number, CURR_CODE?: String, ORG_IS_STORE?: String, CNTRY_CODE?:
String, BAS_ADDR_1?: String, BAS_ADDR_2?: String, BAS_ADDR_3?:
String, BAS_CITY?: String, BAS_STATE?: String, BAS_ZIP?: String,
BAS_ISD?: String, BAS_AREA?: String, BAS_PHONE_NUMB?: String,
BAS_ISD_FAX?: String, BAS_AREA_FAX?: String, BAS_FAX_NUMBER?:
String, DATE_CREATED?: Date, DOWNLOAD_DATE_1?: Date, DOWNLOAD_DATE_2?:
Date, ORG_CLOSED_FR_DATE?: Date, ORG_CLOSED_TO_DATE?: Date,
ORG_COMP_CLOSED?: String, ORG_LVL_NUMBER_S?: Number, ORG_MANAGER_NAME?:
String, OLD_ORG_LVL_PARENT?: Number, ORG_LVL_NUMBER_OLD_S?:
Number, ORG_LVL_PARENT_NUM_OLD_S?: Number, ORG_LVL_PARENT_NUM_S?:
Number, ORG_TYPE_CODE?: String, ORG_AR_NUM?: String, PRC_BOOK_NUMBER?:
Number, ORG_FRN_CODE?: String, ORG_LVL_ID_S?: Number, SYSTEM_OF_MEASURE?:
String, GLN_TYPE_CODE?: String, GLOBAL_LOCATION_NUMBER?: Number,
ALT_TECH_KEY: Number, ORG_DATE_OPENED?: Date, ORG_DATE_COMP?:
Date, ORG_DATE_DISTR?: Date, ORG_DATE_CLOSED?: Date|}, (payload01,
indexOfPayload01) -> ?) overloads:
- map(items: Array<T>, mapper:
(item: T, index: Number) -> R) -> Array<R> reason:
- Expecting
Type: Array<T>, but got: {|ORG_LVL_CHILD: Number, ORG_LVL_CHILD_S:
Number, ISS_TECH_KEY: Number, TRAN_TYPE: String, AUDIT_NUMBER:
Number, ORG_LVL_PARENT?: Number, ORG_NAME_FULL?: String, ORG_NAME_SHORT?:
String, ORG_LVL_NUMBER?: Number, CURR_CODE?: String, ORG_IS_STORE?:
String, CNTRY_CODE?: String, BAS_ADDR_1?: String, BAS_ADDR_2?:
String, BAS_ADDR_3?: String, BAS_CITY?: String, BAS_STATE?:
String, BAS_ZIP?: String, BAS_ISD?: String, BAS_AREA?: String,
BAS_PHONE_NUMB?: String, BAS_ISD_FAX?: String, BAS_AREA_FAX?:
String, BAS_FAX_NUMBER?: String, DATE_CREATED?: Date, DOWNLOAD_DATE_1?:
Date, DOWNLOAD_DATE_2?: Date, ORG_CLOSED_FR_DATE?: Date, ORG_CLOSED_TO_DATE?:
Date, ORG_COMP_CLOSED?: String, ORG_LVL_NUMBER_S?: Number, ORG_MANAGER_NAME?:
String, OLD_ORG_LVL_PARENT?: Number, ORG_LVL_NUMBER_OLD_S?:
Number, ORG_LVL_PARENT_NUM_OLD_S?: Number, ORG_LVL_PARENT_NUM_S?:
Number, ORG_TYPE_CODE?: String, ORG_AR_NUM?: String, PRC_BOOK_NUMBER?:
Number, ORG_FRN_CODE?: String, ORG_LVL_ID_S?: Number, SYSTEM_OF_MEASURE?:
String, GLN_TYPE_CODE?: String, GLOBAL_LOCATION_NUMBER?: Number,
ALT_TECH_KEY: Number, ORG_DATE_OPENED?: Date, ORG_DATE_COMP?:
Date, ORG_DATE_DISTR?: Date, ORG_DATE_CLOSED?: Date|}.
Reasons :
- Expecting Type: Array<T>, but got: {|ORG_LVL_CHILD:
Number, ORG_LVL_CHILD_S: Number, ISS_TECH_KEY: Number, TRAN_TYPE:
String, AUDIT_NUMBER: Number, ORG_LVL_PARENT?: Number, ORG_NAME_FULL?:
String, ORG_NAME_SHORT?: String, ORG_LVL_NUMBER?: Number, CURR_CODE?:
String, ORG_IS_STORE?: String, CNTRY_CODE?: String, BAS_ADDR_1?:
String, BAS_ADDR_2?: String, BAS_ADDR_3?: String, BAS_CITY?:
String, BAS_STATE?: String, BAS_ZIP?: String, BAS_ISD?: String,
BAS_AREA?: String, BAS_PHONE_NUMB?: String, BAS_ISD_FAX?: String,
BAS_AREA_FAX?: String, BAS_FAX_NUMBER?: String, DATE_CREATED?:
Date, DOWNLOAD_DATE_1?: Date, DOWNLOAD_DATE_2?: Date, ORG_CLOSED_FR_DATE?:
Date, ORG_CLOSED_TO_DATE?: Date, ORG_COMP_CLOSED?: String, ORG_LVL_NUMBER_S?:
Number, ORG_MANAGER_NAME?: String, OLD_ORG_LVL_PARENT?: Number,
ORG_LVL_NUMBER_OLD_S?: Number, ORG_LVL_PARENT_NUM_OLD_S?: Number,
ORG_LVL_PARENT_NUM_S?: Number, ORG_TYPE_CODE?: String, ORG_AR_NUM?:
String, PRC_BOOK_NUMBER?: Number, ORG_FRN_CODE?: String, ORG_LVL_ID_S?:
Number, SYSTEM_OF_MEASURE?: String, GLN_TYPE_CODE?: String,
GLOBAL_LOCATION_NUMBER?: Number, ALT_TECH_KEY: Number, ORG_DATE_OPENED?:
Date, ORG_DATE_COMP?: Date, ORG_DATE_DISTR?: Date, ORG_DATE_CLOSED?:
Date|}.
- map(value: Null, mapper: (item: Nothing, index: Nothing)
-> Any) -> Null reason:
- Expecting Type: Null, but got:
{|ORG_LVL_CHILD: Number, ORG_LVL_CHILD_S: Number, ISS_TECH_KEY:
Number, TRAN_TYPE: String, AUDIT_NUMBER: Number, ORG_LVL_PARENT?:
Number, ORG_NAME_FULL?: String, ORG_NAME_SHORT?: String, ORG_LVL_NUMBER?:
Number, CURR_CODE?: String, ORG_IS_STORE?: String, CNTRY_CODE?:
String, BAS_ADDR_1?: String, BAS_ADDR_2?: String, BAS_ADDR_3?:
String, BAS_CITY?: String, BAS_STATE?: String, BAS_ZIP?: String,
BAS_ISD?: String, BAS_AREA?: String, BAS_PHONE_NUMB?: String,
BAS_ISD_FAX?: String, BAS_AREA_FAX?: String, BAS_FAX_NUMBER?:
String, DATE_CREATED?: Date, DOWNLOAD_DATE_1?: Date, DOWNLOAD_DATE_2?:
Date, ORG_CLOSED_FR_DATE?: Date, ORG_CLOSED_TO_DATE?: Date,
ORG_COMP_CLOSED?: String, ORG_LVL_NUMBER_S?: Number, ORG_MANAGER_NAME?:
String, OLD_ORG_LVL_PARENT?: Number, ORG_LVL_NUMBER_OLD_S?:
Number, ORG_LVL_PARENT_NUM_OLD_S?: Number, ORG_LVL_PARENT_NUM_S?:
Number, ORG_TYPE_CODE?: String, ORG_AR_NUM?: String, PRC_BOOK_NUMBER?:
Number, ORG_FRN_CODE?: String, ORG_LVL_ID_S?: Number, SYSTEM_OF_MEASURE?:
String, GLN_TYPE_CODE?: String, GLOBAL_LOCATION_NUMBER?: Number,
ALT_TECH_KEY: Number, ORG_DATE_OPENED?: Date, ORG_DATE_COMP?:
Date, ORG_DATE_DISTR?: Date, ORG_DATE_CLOSED?: Date|}.