Member since
07-10-2024
13
Posts
6
Kudos Received
0
Solutions
10-30-2024
07:50 AM
I am trying to group category & product list with yes/no condition. if merchandiseLevel = 5 then it will consider keyItemNum and populate productList. if merchandiseLevel != 5 then check if webCategoryId is exists then consider webCategoryId and populate categoryList else consider item and populate productList. Expected output {
"priceRuleName" : "Price Rule wIncl and Excl - HCO UK",
"startDate" : "2024-10-30T00:00:00.000Z",
"enddate" : "2024-10-31T23:59:00.000Z",
"storeLocation" : 31082,
"priceRulePromo" : true,
"brand" : "HCO",
"emptyPathName" : "No Everbody Pricing",
"pricePaths" : {
"paths" : [ {
"pathName" : "Members Save on HCO AE",
"customerCondition" : [ {
"targetSegments" : [ "LOGIN" ]
} ],
"catalogCondition" : {
"products" : [ {
"include" : "yes",
"productList" : [ "KIC_123444" ]
}, {
"include" : "no",
"productList" : [ "KIC_1111111" ]
} ],
"category" : [ {
"include" : "yes",
"categoryList" : [ "WEBCTGY_85265"]
}, {
"include" : "no",
"categoryList" : [ "WEBCTGY_166330"]
} ]
},
"calculatePrice" : [ {
"RPMPromoId" : 569,
"RPMCompId" : 2173,
"calculationType" : 2,
"amount" : 30,
"percentage" : 0
} ]
}, {
"pathName" : "Members Save on Bottoms",
"customerCondition" : [ {
"targetSegments" : [ "LOGIN" ]
} ],
"catalogCondition" : {
"products" : [ {
"include" : "no",
"productList" : [ "KIC_1111111" ]
}, {
"include" : "yes",
"productList" : [ "KIC_123444" ]
} ],
"category" : [ {
"include" : "yes",
"categoryList" : [ "WEBCTGY_166330"]
}, {
"include" : "no",
"categoryList" : [ "WEBCTGY_85265"]
} ]
},
"calculatePrice" : [ {
"RPMPromoId" : 569,
"RPMCompId" : 2173,
"calculationType" : 2,
"amount" : 20,
"percentage" : 0
} ]
} ]
}
}
... View more
10-29-2024
02:27 PM
1 Kudo
Hi, Could be please help me why categoryList is combining all values inside one list instead of 2nd index of paths object , like productList is working fine only difference is that i added one more condition for categoryList that is causing the issue. could you please suggest what i am missing here ? Input {
"correlationId": "4c7f8c69-36eb-4f65-bded-6ed08503631a",
"sourceSystemId": "PCS",
"messageTimestamp": "2024-10-29T13:10:54.297-04:00",
"id": 2173,
"promotionId": 569,
"offerId": 2173,
"description": "Price Rule wIncl and Excl - HCO UK",
"levelCode": 0,
"typeCode": 0,
"templateId": 4,
"isCouponCodeRequired": 0,
"startDateTime": "2024-10-30T00:00:00.000Z",
"endDateTime": "2024-10-31T23:59:00.000Z",
"exclusiveDiscountInd": 0,
"tiers": [
{
"conditions": [
{
"conditionId": 374,
"buySpendType": 0,
"buySpendValue": 1,
"buyUom": "EA",
"conditionsMerch": [
{
"merchandiseLevel": 5,
"dept": 0,
"deptClass": 0,
"uniqueClass": 0,
"subClass": 0,
"uniqueSubClass": 0,
"item": "101700348",
"excludeInd": 0,
"keyItemNum": "KIC_123444",
"conditionMerchId": 3110
},
{
"merchandiseLevel": 5,
"dept": 0,
"deptClass": 0,
"uniqueClass": 0,
"subClass": 0,
"uniqueSubClass": 0,
"item": "101700348",
"excludeInd": 1,
"keyItemNum": "KIC_1111111",
"conditionMerchId": 3110
},
{
"merchandiseLevel": 6,
"dept": 0,
"deptClass": 0,
"uniqueClass": 0,
"subClass": 0,
"uniqueSubClass": 0,
"item": "101700348",
"excludeInd": 0,
"webCategoryId": "WEBCTGY_85265",
"conditionMerchId": 3110
},
{
"merchandiseLevel": 6,
"dept": 0,
"deptClass": 0,
"uniqueClass": 0,
"subClass": 0,
"uniqueSubClass": 0,
"item": "101700364",
"excludeInd": 1,
"webCategoryId": "WEBCTGY_166330",
"conditionMerchId": 3111
}
]
}
],
"rewards": [
{
"rewardId": 2293,
"changeType": 2,
"changeAmount": 30,
"changePercent": 0,
"quantityToDiscount": 99,
"applyInd": 2,
"rewardsMerch": []
}
],
"priceRuleAttributes": [
{
"id": "PR_EMPTY_PATH_NAME",
"type": "CFA",
"values": [
"No Everbody Pricing"
]
},
{
"id": "PR_PATH_NAME",
"type": "CFA",
"values": [
"Members Save on HCO AE"
]
},
{
"id": "PR_TARGET_SEGMENT",
"type": "CFA",
"values": [
"LOGIN"
]
}
]
},
{
"conditions": [
{
"conditionId": 371,
"buySpendType": 0,
"buySpendValue": 1,
"buyUom": "EA",
"conditionsMerch": [
{
"merchandiseLevel": 5,
"dept": 0,
"deptClass": 0,
"uniqueClass": 0,
"subClass": 0,
"uniqueSubClass": 0,
"item": "101700348",
"excludeInd": 1,
"keyItemNum": "KIC_1111111",
"conditionMerchId": 3110
},
{
"merchandiseLevel": 5,
"dept": 0,
"deptClass": 0,
"uniqueClass": 0,
"subClass": 0,
"uniqueSubClass": 0,
"item": "101700348",
"excludeInd": 0,
"keyItemNum": "KIC_123444",
"conditionMerchId": 3110
},
{
"merchandiseLevel": 6,
"dept": 0,
"deptClass": 0,
"uniqueClass": 0,
"subClass": 0,
"uniqueSubClass": 0,
"item": "101700348",
"excludeInd": 1,
"webCategoryId": "WEBCTGY_85265",
"conditionMerchId": 3110
},
{
"merchandiseLevel": 6,
"dept": 0,
"deptClass": 0,
"uniqueClass": 0,
"subClass": 0,
"uniqueSubClass": 0,
"item": "101700364",
"excludeInd": 0,
"webCategoryId": "WEBCTGY_166330",
"conditionMerchId": 3105
}
]
}
],
"rewards": [
{
"rewardId": 2290,
"changeType": 2,
"changeAmount": 20,
"changePercent": 0,
"quantityToDiscount": 99,
"applyInd": 2,
"rewardsMerch": []
}
],
"priceRuleAttributes": [
{
"id": "PR_PATH_NAME",
"type": "CFA",
"values": [
"Members Save on Bottoms"
]
},
{
"id": "PR_TARGET_SEGMENT",
"type": "CFA",
"values": [
"LOGIN"
]
}
]
}
],
"locations": [
{
"location": 31082,
"action": "INSERT",
"locationType": "S"
}
],
"customAttributes": [
{
"id": "CND_EQ_RWD",
"type": "CFA",
"valueBoolean": false
},
{
"id": "PR_PRICE_RULE_PROMO",
"type": "CFA",
"valueBoolean": true
},
{
"id": "HOME_OFFICE_ASSOC_PROMO",
"type": "CFA",
"valueBoolean": false
},
{
"id": "WEBCAT_PROMO",
"type": "CFA",
"valueBoolean": true
},
{
"id": "REDEMPTION_CHANNELS",
"type": "CFA",
"values": [
"DTC"
]
},
{
"id": "WEB_DESKTOP",
"type": "CFA",
"valueBoolean": false
},
{
"id": "APPLYAUTOMATICALLY",
"type": "CFA",
"values": [
"AUTO"
]
},
{
"id": "HCO_BRAND",
"type": "CFA",
"valueBoolean": true
},
{
"id": "KIDS_BRAND",
"type": "CFA",
"valueBoolean": false
},
{
"id": "DTC_BIZ_PROMO_CAT",
"type": "CFA",
"values": [
"Members Save on Bottoms"
]
},
{
"id": "EMPLOYEESELIGIBLE",
"type": "CFA",
"valueBoolean": false
},
{
"id": "LOGGEDON",
"type": "CFA",
"valueBoolean": false
},
{
"id": "WEB_MOBILE",
"type": "CFA",
"valueBoolean": false
},
{
"id": "DTC_BIZ_PROMO_CAT",
"type": "CFA",
"values": [
"Member Pricing-HCO UK"
]
},
{
"id": "ALL_CHANNELS",
"type": "CFA",
"valueBoolean": true
},
{
"id": "APP",
"type": "CFA",
"valueBoolean": false
},
{
"id": "EXTERNALNAME",
"type": "CFA",
"values": [
"Members Save on Bottoms - HCO UK"
]
},
{
"id": "ANF_BRAND",
"type": "CFA",
"valueBoolean": false
},
{
"id": "GH_BRAND",
"type": "CFA",
"valueBoolean": false
},
{
"id": "PHYSICAL_STORE",
"type": "CFA",
"valueBoolean": false
},
{
"id": "ALLOW_UNIQUE_CD_REPLEN",
"type": "CFA",
"valueBoolean": false
},
{
"id": "EXTERNALNAME",
"type": "CFA",
"values": [
"Member Pricing-HCO UK"
]
},
{
"id": "CATEGORY",
"type": "CFA",
"values": [
"ECOM"
]
},
{
"id": "STORES_BIZ_PROMO_CAT",
"type": "CFA",
"values": [
"NA"
]
},
{
"id": "CALL_CENTER",
"type": "CFA",
"valueBoolean": false
}
],
"attributes": {
"priceType": "PROMOTION",
"createTimestamp": "2024-10-29T13:02:34.000-04:00",
"createUserId": "REST_USER",
"approvalId": "REST_USER",
"lastUpdateProgramId": "PCS",
"lastUpdateTimestamp": "2024-10-29T13:07:35.000-04:00",
"lastUpdateUserId": "REST_USER",
"emergencyInd": false,
"promoTypeCode": "TP"
}
} Spec [
{
"operation": "modify-overwrite-beta",
"spec": {
"tiers": {
"*": {
"conditions": {
"*": {
"conditionsMerch": {
"*": {
"webCategoryId": ["=toString", "notfound"]
}
}
}
}
}
}
}
},
{
"operation": "shift",
"spec": {
"description": "priceRuleName",
"startDateTime": "startDate",
"endDateTime": "enddate",
"locations": {
"0": {
"location": "storeLocation"
}
},
"customAttributes": {
"*": {
"id": {
"PR_PRICE_RULE_PROMO": {
"@(2,valueBoolean)": "priceRulePromo"
},
"ANF_BRAND": {
"@(2,valueBoolean)": {
"true": {
"#ANF": "brand"
}
}
},
"KIDS_BRAND": {
"@(2,valueBoolean)": {
"true": {
"#KIDS": "brand"
}
}
},
"HCO_BRAND": {
"@(2,valueBoolean)": {
"true": {
"#HCO": "brand"
}
}
},
"GH_BRAND": {
"@(2,valueBoolean)": {
"true": {
"#GH": "brand"
}
}
}
}
}
},
"tiers": {
"*": {
"priceRuleAttributes": {
"*": {
"id": {
"PR_EMPTY_PATH_NAME": {
"@(2,values[0])": "emptyPathName"
},
"PR_PATH_NAME": {
"@(2,values[0])": "pricePaths.paths.[&5].pathName"
},
"PR_TARGET_SEGMENT": {
"@(2,values)": "pricePaths.paths.[&5].customerCondition[#2].targetSegments"
},
"PR_CURR_CD": {
"@(2,values[0])": "pricePaths.paths.[&5].currencyCondition[#2].currency"
}
}
}
},
"conditions": {
"*": {
"conditionsMerch": {
"*": {
"merchandiseLevel": {
"5": {
"@(2,excludeInd)": {
"0": {
"@(4,keyItemNum)": "pricePaths.paths[&9].catalogCondition.products.yes.productList[]"
},
"1": {
"@(4,keyItemNum)": "pricePaths.paths[&9].catalogCondition.products.no.productList[]"
}
}
},
"*": {
"@(2,webCategoryId)": {
"|notfound": {
"@(4,excludeInd)": {
"0": {
"@(6,item)": "pricePaths.paths[&9].catalogCondition.products.yes.productList[]"
},
"1": {
"@(6,item)": "pricePaths.paths[&9].catalogCondition.products.no.productList[]"
}
}
},
"*": {
"@(4,excludeInd)": {
"0": {
"@(6,webCategoryId)": "pricePaths.paths[&9].catalogCondition.category.yes.categoryList[]"
},
"1": {
"@(6,webCategoryId)": "pricePaths.paths[&9].catalogCondition.category.no.categoryList[]"
}
}
}
}
}
}
}
}
}
},
"rewards": {
"*": {
"changeType": "pricePaths.paths.[&3].calculatePrice[&1].calculationType",
"changeAmount": "pricePaths.paths.[&3].calculatePrice[&1].amount",
"changePercent": "pricePaths.paths.[&3].calculatePrice[&1].percentage",
"@(4,promotionId)": "pricePaths.paths.[&3].calculatePrice[&1].RPMPromoId",
"@(4,offerId)": "pricePaths.paths.[&3].calculatePrice[&1].RPMCompId",
"@(2,priceRuleAttributes)": {
"*": {
"id": {
"PR_CURR_CD": {
"@(2,values[0])": "pricePaths.paths.[&7].calculatePrice[&4].currency"
}
}
}
}
}
}
}
}
}
},
{
"operation": "shift",
"spec": {
"*": "&",
"pricePaths": {
"paths": {
"*": {
"*": "&3.&2[&1].&",
"catalogCondition": {
"*": {
"*": {
"*": "&6.&5[&4].&3.&2[#2].&",
"$": "&6.&5[&4].&3.&2[#2].include"
}
}
}
}
}
}
}
}
]
... View more
Labels:
- Labels:
-
Apache NiFi
09-24-2024
12:50 PM
1 Kudo
Hi, I am trying to group webCategoryId and item with yes/no flag with some conditions inside array. 1 - if webCategoryId variable is present and not empty value then only use webCategoryId, ignore item value if present inside array. 2 - if webCategoryId variable is not present or present with empty value then use item if item value is present inside array. Could you please advice. Input {
"correlationId": "3242a7b4-7929-43b3-9fb6-0d7e173373af",
"sourceSystemId": "PCS",
"messageTimestamp": "2024-05-03T00:00:00",
"id": 1234,
"promotionId": 2303,
"offerId": 2303,
"description": "Members Get Tees $15",
"customerDescription": "Members Get Tees $15",
"levelCode": 0,
"typeCode": 3,
"templateId": 4,
"couponCode": null,
"isCouponCodeRequired": 0,
"startDatetime": "2024-06-20T00:00:00",
"endDatetime": "2024-06-24T23:59:00",
"cancelationDatetime": null,
"comments": null,
"distributionRuleCode": null,
"exclusiveDiscountInd": 0,
"tiers": [
{
"conditions": [
{
"conditionId": 1134,
"buySpendType": 0,
"buySpendValue": 1,
"buyUom": "EA",
"conditionsMerch": [
{
"conditionMerchId": 85339,
"merchandiseLevel": 5,
"deptClass": 0,
"uniqueClass": 0,
"subClass": 0,
"uniqueSubClass": 0,
"item": "613631673",
"diffId": "012",
"excludeInd": 0,
"cancelDatetime": null,
"supplierSite": null,
"brandName": null,
"class": 0
},
{
"conditionMerchId": 85339,
"merchandiseLevel": 5,
"deptClass": 0,
"uniqueClass": 0,
"subClass": 0,
"uniqueSubClass": 0,
"item": "613631674",
"webCategoryId": "",
"diffId": "012",
"excludeInd": 0,
"cancelDatetime": null,
"supplierSite": null,
"brandName": null,
"class": 0
},
{
"conditionMerchId": 85340,
"merchandiseLevel": 5,
"deptClass": 0,
"uniqueClass": 0,
"subClass": 0,
"uniqueSubClass": 0,
"webCategoryId": "613631673",
"diffId": "023",
"excludeInd": 1,
"cancelDatetime": null,
"supplierSite": null,
"brandName": null,
"class": 0
},
{
"conditionMerchId": 85341,
"merchandiseLevel": 5,
"deptClass": 0,
"uniqueClass": 0,
"subClass": 0,
"uniqueSubClass": 0,
"item": "12334",
"webCategoryId": "613631673",
"diffId": "013",
"excludeInd": 0,
"cancelDatetime": null,
"supplierSite": null,
"brandName": null,
"class": 0
}
]
}
],
"rewards": [
{
"rewardId": 8127,
"changeType": 2,
"changeAmount": 15,
"changePercent": null,
"quantityToDiscount": null,
"applyInd": 2,
"rewardsMerch": []
}
],
"priceRuleAttributes": [
{
"type": "CFA",
"id": "PR_PATH_NAME",
"values": [
"MEMBERS"
]
},
{
"type": "CFA",
"id": "PR_PRICE_RULE_PROMO",
"valueBoolean": true
},
{
"type": "CFA",
"id": "PR_TARGET_SEGMENT",
"values": [
"PAS_LOGGEDIN",
"LOGGEDIN",
"PAS_NOT_LOGGEDIN"
]
},
{
"type": "CFA",
"id": "PR_CURR_CONDITION",
"values": [
"USD"
]
}
]
},
{
"conditions": [
{
"conditionId": 1135,
"buySpendType": 0,
"buySpendValue": 1,
"buyUom": "EA",
"conditionsMerch": [
{
"conditionMerchId": 85342,
"merchandiseLevel": 5,
"deptClass": 0,
"uniqueClass": 0,
"subClass": 0,
"uniqueSubClass": 0,
"item": "",
"categoryId": "613631673",
"diffId": "012",
"excludeInd": 0,
"cancelDatetime": null,
"supplierSite": null,
"brandName": null,
"class": 0
},
{
"conditionMerchId": 85343,
"merchandiseLevel": 5,
"deptClass": 0,
"uniqueClass": 0,
"subClass": 0,
"uniqueSubClass": 0,
"item": "",
"categoryId": "613631674",
"diffId": "023",
"excludeInd": 1,
"cancelDatetime": null,
"supplierSite": null,
"brandName": null,
"class": 0
}
]
}
],
"rewards": [
{
"rewardId": 8128,
"changeType": 2,
"changeAmount": 18,
"changePercent": null,
"quantityToDiscount": null,
"applyInd": 2,
"rewardsMerch": []
}
],
"priceRuleAttributes": [
{
"type": "CFA",
"id": "PR_PATH_NAME",
"values": [
"NON MEMBERS"
]
},
{
"type": "CFA",
"id": "PR_EMPTY_PATH_NAME",
"values": [
"NON"
]
},
{
"type": "CFA",
"id": "PR_PRICE_RULE_PROMO",
"valueBoolean": true
}
]
}
],
"locations": [
{
"location": 10051,
"cancelDateTime": null,
"action": "INSERT",
"locationType": "S"
}
],
"attributes": {
"webCategoryInd": false,
"currencyCode": "USD",
"priceType": "PROMOTION",
"createTimestamp": "2024-05-03T00:00:00",
"createUserId": "BRANDIE_YAWS@ANFCORP.COM",
"approvalId": "BRANDIE_YAWS@ANFCORP.COM",
"lastUpdateProgramId": "PCS",
"lastUpdateTimestamp": "2024-05-03T00:00:00",
"lastUpdateUserId": "BRANDIE_YAWS@ANFCORP.COM",
"emergencyInd": false,
"promoTypeCode": "TP"
},
"customAttributes": [
{
"type": "CFA",
"id": "PR_PRICE_RULE_PROMO",
"valueBoolean": true
}
]
} Spec [
{
"operation": "shift",
"spec": {
"description": "priceRuleName",
"startDateTime": "startDate",
"endDateTime": "enddate",
"locations": {
"0": {
"location": "storeLocation"
}
},
"customAttributes": {
"*": {
"id": {
"PR_PRICE_RULE_PROMO": {
"@(2,valueBoolean)": "priceRulePromo"
}
}
}
},
"tiers": {
"*": {
"priceRuleAttributes": {
"*": {
"id": {
"PR_EMPTY_PATH_NAME": {
"@(2,values[0])": "emptyPathName"
},
"PR_PATH_NAME": {
"@(2,values[0])": "pricePaths.paths.[&5].pathName"
},
"PR_TARGET_SEGMENT": {
"@(2,values)": "pricePaths.paths.[&5].customerCondition[#2].targetSegments"
},
"PR_CURR_CD": {
"@(2,values[0])": "pricePaths.paths.[&5].currencyCondition[#2].currency"
}
}
}
},
"conditions": {
"*": {
"conditionsMerch": {
"*": {
"item": {
"": {
"@(2,excludeInd)": {
"0": {
"@(4,webCategoryId)": "pricePaths.paths[&9].catalogCondition.category.yes.categoryList[]"
},
"1": {
"@(4,webCategoryId)": "pricePaths.paths[&9].catalogCondition.category.no.categoryList[]"
}
}
},
"*": {
"@(2,excludeInd)": {
"0": {
"@(4,item)": "pricePaths.paths[&9].catalogCondition.products.yes.productList[]"
},
"1": {
"@(4,item)": "pricePaths.paths[&9].catalogCondition.products.no.productList[]"
}
}
}
}
}
}
}
},
"rewards": {
"*": {
"changeType": "pricePaths.paths.[&3].calculatePrice[&1].calculationType",
"changeAmount": "pricePaths.paths.[&3].calculatePrice[&1].amount",
"changePercent": "pricePaths.paths.[&3].calculatePrice[&1].percentage",
"@(4,promotionId)": "pricePaths.paths.[&3].calculatePrice[&1].RPMPromoId",
"@(4,offerId)": "pricePaths.paths.[&3].calculatePrice[&1].RPMCompId",
"@(2,priceRuleAttributes)": {
"*": {
"id": {
"PR_CURR_CD": {
"@(2,values[0])": "pricePaths.paths.[&7].calculatePrice[&4].currency"
}
}
}
}
}
}
}
}
}
}
,
{
"operation": "shift",
"spec": {
"*": "&",
"pricePaths": {
"paths": {
"*": {
"*": "&3.&2[&1].&",
"catalogCondition": {
"*": {
"*": {
"*": "&6.&5[&4].&3.&2[#2].&",
"$": "&6.&5[&4].&3.&2[#2].include"
}
}
}
}
}
}
}
}
]
... View more
Labels:
- Labels:
-
Apache NiFi
07-24-2024
06:34 AM
1 Kudo
Sorry i shared simplified input JSON, here is input so priceRuleAttributes array can have more than one value or can be empty. {
"tiers": [
{
"rewards": [
{
"rewardId": 8127,
"changeType": 2,
"changeAmount": 15,
"changePercent": null,
"quantityToDiscount": null,
"applyInd": 2,
"rewardsMerch": []
}
],
"priceRuleAttributes": [
{
"type": "CFA",
"id": "PR_BRANCH_NAME",
"values": [
"MEMBERS"
]
},
{
"type": "CFA",
"id": "PR_PRICE_RULE_PROMO",
"valueBoolean": true
},
{
"type": "CFA",
"id": "PR_TARGET_SEGMENT",
"values": [
"PAS_LOGGEDIN",
"LOGGEDIN",
"PAS_NOT_LOGGEDIN"
]
},
{
"type": "CFA",
"id": "PR_CURR_CONDITION",
"values": [
"AED"
]
}
]
},
{
"rewards": [
{
"rewardId": 8128,
"changeType": 2,
"changeAmount": 18,
"changePercent": null,
"quantityToDiscount": null,
"applyInd": 2,
"rewardsMerch": []
}
],
"priceRuleAttributes": [
{
"type": "CFA",
"id": "PR_BRANCH_NAME",
"values": [
"MEMBERS"
]
},
{
"type": "CFA",
"id": "PR_CURR_CONDITION",
"values": [
"USD"
]
}
]
}
]
} Output {
"paths" : [ {
"currencyCondition" : [ {
"currency" : "AED"
} ],
"calculatePrice" : [ {
"calculationType" : 2,
"amount" : 15,
"percentage" : null,
"currency" : "AED"
} ]
}, {
"currencyCondition" : [ {
"currency" : "USD"
} ],
"calculatePrice" : [ {
"calculationType" : 2,
"amount" : 18,
"percentage" : null,
"currency" : "USD"
} ]
} ]
}
... View more
07-23-2024
10:44 AM
In that case you made it static as priceRuleAttributes array can have multiple dynamic values and its index can be change for PR_CURR_CONDITION. "priceRuleAttributes": [
{
"type": "CFA",
"id": "PR_BRANCH_NAME",
"values": [
"MEMBERS"
]
},
{
"type": "CFA",
"id": "PR_PRICE_RULE_PROMO",
"valueBoolean": true
},
{
"type": "CFA",
"id": "PR_TARGET_SEGMENT",
"values": [
"PAS_LOGGEDIN",
"LOGGEDIN",
"PAS_NOT_LOGGEDIN"
]
},
{
"type": "CFA",
"id": "PR_CURR_CONDITION",
"values": [
"AED"
]
}
]
... View more
07-22-2024
10:12 PM
1 Kudo
Hello, Could you please help me what i am missing here.. i am trying to copy currency value from currency condition and adding it in calculatePrice array. Input {
"tiers": [
{
"rewards": [
{
"rewardId": 8127,
"changeType": 2,
"changeAmount": 15,
"changePercent": null,
"quantityToDiscount": null,
"applyInd": 2,
"rewardsMerch": []
}
],
"priceRuleAttributes": [
{
"type": "CFA",
"id": "PR_CURR_CONDITION",
"values": [
"AED"
]
}
]
},
{
"rewards": [
{
"rewardId": 8128,
"changeType": 2,
"changeAmount": 18,
"changePercent": null,
"quantityToDiscount": null,
"applyInd": 2,
"rewardsMerch": []
}
],
"priceRuleAttributes": [
{
"type": "CFA",
"id": "PR_CURR_CONDITION",
"values": [
"USD"
]
}
]
}
]
} Spec [
{
"operation": "shift",
"spec": {
"tiers": {
"*": {
"priceRuleAttributes": {
"*": {
"id": {
"PR_CURR_CONDITION": {
"@(2,values[0])": "paths.[&5].currencyCondition[#2].currency"
}
}
}
},
"rewards": {
"*": {
"changeType": "paths.[&3].calculatePrice[&1].calculationType",
"changeAmount": "paths.[&3].calculatePrice[&1].amount",
"changePercent": "paths.[&3].calculatePrice[&1].percentage"
}
}
}
}
}
},
{
"operation": "modify-default-beta",
"spec": {
"paths": {
"*": {
"calculatePrice": {
"*": {
"currency": "@(0,currencyCondition[&].currency)"
}
}
}
}
}
}
] Expected output {
"paths" : [ {
"currencyCondition" : [ {
"currency" : "AED"
} ],
"calculatePrice" : [ {
"calculationType" : 2,
"amount" : 15,
"percentage" : null,
"currency" : "AED"
} ]
}, {
"currencyCondition" : [ {
"currency" : "USD"
} ],
"calculatePrice" : [ {
"calculationType" : 2,
"amount" : 18,
"percentage" : null,
"currency" : "AED"
} ]
} ]
}
... View more
Labels:
- Labels:
-
Apache NiFi
07-12-2024
09:49 AM
Thanks really appreciated, is it good to use JSLT at java level , any cons as compare to JOLT. Also how can i get single value for pathName instead of List. "pathName" : [ "MEMBERS" ] -- >. "pathName" : "MEMBERS"
... View more
07-11-2024
12:42 PM
1 Kudo
Here is simplified input and output json. Input {
"tiers": [
{
"conditions": [
{
"conditionsMerch": [
{
"item": "613631673",
"categoryId": "",
"excludeInd": 0
},
{
"item": "613631674",
"categoryId": "",
"excludeInd": 0
},
{
"item": "613631675",
"categoryId": "",
"excludeInd": 1
},
{
"item": "",
"categoryId": "123455",
"excludeInd": 0
}
]
}
]
},
{
"conditions": [
{
"conditionsMerch": [
{
"item": "",
"categoryId": "613631673",
"excludeInd": 0
},
{
"item": "",
"categoryId": "613631674",
"excludeInd": 1
},
{
"item": "",
"categoryId": "613631675",
"excludeInd": 1
}
]
}
]
}
]
} Output {
"pricePaths": {
"paths": [
{
"catalogCondition": {
"category": [
{
"include": "no",
"categoryList": [
"123455"
]
}
],
"products": [
{
"include": "no",
"productList": [
"613631673",
"613631674"
]
},
{
"include": "yes",
"productList": [
"613631675",
]
}
]
}
},
{
"catalogCondition": {
"category": [
{
"include": "no",
"categoryList": [
"613631673"
]
},
{
"include": "yes",
"categoryList": [
"613631674",
"613631675"
]
}
]
}
]
}
}
... View more
07-11-2024
08:57 AM
Hello, is it possible to create seperate individual list from one list based on some conditions. e.g i have a list that have category & product information so i have to create individual list based on category/item id with excludeInd flag 0/1, List A - CategoryIds List -> Exclude List B - CategoryIds List -> Include List C - ProductIds List -> Exclude List D -ProductIds List -> Include Input {
"correlationId": "3242a7b4-7929-43b3-9fb6-0d7e173373af",
"sourceSystemId": "PCS",
"messageTimestamp": "2024-05-03T00:00:00",
"id": 1234,
"promotionId": 2303,
"offerId": 2303,
"description": "Members Get Tees $15",
"customerDescription": "Members Get Tees $15",
"levelCode": 0,
"typeCode": 3,
"templateId": 4,
"couponCode": null,
"isCouponCodeRequired": 0,
"startDatetime": "2024-06-20T00:00:00",
"endDatetime": "2024-06-24T23:59:00",
"cancelationDatetime": null,
"comments": null,
"distributionRuleCode": null,
"exclusiveDiscountInd": 0,
"tiers": [
{
"conditions": [
{
"conditionId": 1134,
"buySpendType": 0,
"buySpendValue": 1,
"buyUom": "EA",
"conditionsMerch": [
{
"conditionMerchId": 85339,
"merchandiseLevel": 5,
"deptClass": 0,
"uniqueClass": 0,
"subClass": 0,
"uniqueSubClass": 0,
"item": "613631673",
"categoryId": "",
"diffId": "012",
"excludeInd": 0,
"cancelDatetime": null,
"supplierSite": null,
"brandName": null,
"class": 0
},
{
"conditionMerchId": 85339,
"merchandiseLevel": 5,
"deptClass": 0,
"uniqueClass": 0,
"subClass": 0,
"uniqueSubClass": 0,
"item": "613631674",
"categoryId": "",
"diffId": "012",
"excludeInd": 0,
"cancelDatetime": null,
"supplierSite": null,
"brandName": null,
"class": 0
},
{
"conditionMerchId": 85340,
"merchandiseLevel": 5,
"deptClass": 0,
"uniqueClass": 0,
"subClass": 0,
"uniqueSubClass": 0,
"item": "613631673",
"categoryId": "",
"diffId": "023",
"excludeInd": 1,
"cancelDatetime": null,
"supplierSite": null,
"brandName": null,
"class": 0
},
{
"conditionMerchId": 85341,
"merchandiseLevel": 5,
"deptClass": 0,
"uniqueClass": 0,
"subClass": 0,
"uniqueSubClass": 0,
"item": "",
"categoryId": "613631673",
"diffId": "013",
"excludeInd": 0,
"cancelDatetime": null,
"supplierSite": null,
"brandName": null,
"class": 0
}
]
}
],
"rewards": [
{
"rewardId": 8127,
"changeType": 2,
"changeAmount": 15,
"changePercent": null,
"quantityToDiscount": null,
"applyInd": 2,
"rewardsMerch": []
}
],
"priceRuleAttributes": [
{
"type": "CFA",
"id": "PR_BRANCH_NAME",
"values": [
"MEMBERS"
]
},
{
"type": "CFA",
"id": "PR_PRICE_RULE_PROMO",
"valueBoolean": true
},
{
"type": "CFA",
"id": "PR_TARGET_SEGMENT",
"values": [
"PAS_LOGGEDIN",
"LOGGEDIN",
"PAS_NOT_LOGGEDIN"
]
}
]
},
{
"conditions": [
{
"conditionId": 1135,
"buySpendType": 0,
"buySpendValue": 1,
"buyUom": "EA",
"conditionsMerch": [
{
"conditionMerchId": 85342,
"merchandiseLevel": 5,
"deptClass": 0,
"uniqueClass": 0,
"subClass": 0,
"uniqueSubClass": 0,
"item": "",
"categoryId": "613631673",
"diffId": "012",
"excludeInd": 0,
"cancelDatetime": null,
"supplierSite": null,
"brandName": null,
"class": 0
},
{
"conditionMerchId": 85343,
"merchandiseLevel": 5,
"deptClass": 0,
"uniqueClass": 0,
"subClass": 0,
"uniqueSubClass": 0,
"item": "",
"categoryId": "613631674",
"diffId": "023",
"excludeInd": 1,
"cancelDatetime": null,
"supplierSite": null,
"brandName": null,
"class": 0
}
]
}
],
"rewards": [
{
"rewardId": 8128,
"changeType": 2,
"changeAmount": 18,
"changePercent": null,
"quantityToDiscount": null,
"applyInd": 2,
"rewardsMerch": []
}
],
"priceRuleAttributes": [
{
"type": "CFA",
"id": "PR_BRANCH_NAME",
"values": [
"NON MEMBERS"
]
},
{
"type": "CFA",
"id": "PR_PRICE_RULE_PROMO",
"valueBoolean": true
}
]
}
],
"locations": [
{
"location": 10051,
"cancelDateTime": null,
"action": "INSERT",
"locationType": "S"
}
],
"attributes": {
"webCategoryInd": false,
"currencyCode": "USD",
"priceType": "PROMOTION",
"createTimestamp": "2024-05-03T00:00:00",
"createUserId": "BRANDIE_YAWS@ANFCORP.COM",
"approvalId": "BRANDIE_YAWS@ANFCORP.COM",
"lastUpdateProgramId": "PCS",
"lastUpdateTimestamp": "2024-05-03T00:00:00",
"lastUpdateUserId": "BRANDIE_YAWS@ANFCORP.COM",
"emergencyInd": false,
"promoTypeCode": "TP"
},
"customAttributes": [
{
"type": "CFA",
"id": "ALLOW_UNIQUE_CD_REPLEN",
"valueBoolean": false
},
{
"type": "CFA",
"id": "ANF_BRAND",
"valueBoolean": false
},
{
"type": "CFA",
"id": "ANF_MENS",
"valueBoolean": false
},
{
"type": "CFA",
"id": "ANF_WOMENS",
"valueBoolean": false
},
{
"type": "CFA",
"id": "APP",
"valueBoolean": false
},
{
"type": "CFA",
"id": "APPLYDEALORDER",
"valueBoolean": false
},
{
"type": "CFA",
"id": "BESTDEAL",
"valueBoolean": false
},
{
"type": "CFA",
"id": "BOGO",
"valueBoolean": false
},
{
"type": "CFA",
"id": "CALL_CENTER",
"valueBoolean": false
},
{
"type": "CFA",
"id": "CATEGORY",
"values": [
"1"
]
},
{
"type": "CFA",
"id": "CND_EQ_RWD",
"valueBoolean": false
},
{
"type": "CFA",
"id": "CND_FLAGS",
"valueBoolean": false
},
{
"type": "CFA",
"id": "CND_MRCHTYPE_EXCL_FP",
"valueBoolean": false
},
{
"type": "CFA",
"id": "CND_MRCHTYPE_EXCL_PROMO",
"valueBoolean": false
},
{
"type": "CFA",
"id": "CND_MRCHTYPE_EXCL_REDLINES",
"valueBoolean": false
},
{
"type": "CFA",
"id": "CND_TARGET",
"valueBoolean": false
},
{
"type": "CFA",
"id": "ECOMM_BIZ_PROMO_CAT",
"values": [
"Member Pricing"
]
},
{
"type": "CFA",
"id": "EMPLOYEESELIGIBLE",
"valueBoolean": true
},
{
"type": "CFA",
"id": "EXTERNALNAME",
"values": [
"Members Get Tees $15"
]
},
{
"type": "CFA",
"id": "FLOOR",
"valueBoolean": false
},
{
"type": "CFA",
"id": "GH_BRAND",
"valueBoolean": false
},
{
"type": "CFA",
"id": "GH_FEMALE",
"valueBoolean": false
},
{
"type": "CFA",
"id": "GH_MALE",
"valueBoolean": false
},
{
"type": "CFA",
"id": "HCO_BRAND",
"valueBoolean": false
},
{
"type": "CFA",
"id": "HCO_GIRLS",
"valueBoolean": false
},
{
"type": "CFA",
"id": "HCO_GUYS",
"valueBoolean": false
},
{
"type": "CFA",
"id": "HOME_OFFICE_ASSOC_PROMO",
"valueBoolean": false
},
{
"type": "CFA",
"id": "KIDS_BOYS",
"valueBoolean": false
},
{
"type": "CFA",
"id": "KIDS_BRAND",
"valueBoolean": false
},
{
"type": "CFA",
"id": "KIDS_GIRLS",
"valueBoolean": false
},
{
"type": "CFA",
"id": "LOGGEDON",
"valueBoolean": false
},
{
"type": "CFA",
"id": "PHYSICAL_STORE",
"valueBoolean": false
},
{
"type": "CFA",
"id": "PR_BRANCH_NAME",
"values": [
"MEMBERS"
]
},
{
"type": "CFA",
"id": "PR_PRICE_RULE_PROMO",
"valueBoolean": true
},
{
"type": "CFA",
"id": "PR_TARGET_SEGMENT",
"values": [
"1"
]
},
{
"type": "CFA",
"id": "REDEMPTION_CHANNELS",
"values": [
"2"
]
},
{
"type": "CFA",
"id": "RWD_FLAGS",
"valueBoolean": false
},
{
"type": "CFA",
"id": "RWD_MRCHTYPE_EXCL_FP",
"valueBoolean": false
},
{
"type": "CFA",
"id": "RWD_MRCHTYPE_EXCL_PROMO",
"valueBoolean": false
},
{
"type": "CFA",
"id": "RWD_MRCHTYPE_EXCL_REDLINES",
"valueBoolean": false
},
{
"type": "CFA",
"id": "RWD_TARGET",
"valueBoolean": false
},
{
"type": "CFA",
"id": "SHIPPING_PROMO",
"valueBoolean": false
},
{
"type": "CFA",
"id": "STORES_BIZ_PROMO_CAT",
"values": [
"NA"
]
},
{
"type": "CFA",
"id": "UPTO",
"valueBoolean": false
},
{
"type": "CFA",
"id": "WEBCAT_PROMO",
"valueBoolean": false
},
{
"type": "CFA",
"id": "WEB_DESKTOP",
"valueBoolean": false
},
{
"type": "CFA",
"id": "WEB_MOBILE",
"valueBoolean": false
}
]
} Spec [
{
"operation": "shift",
"spec": {
"description": "priceRuleName",
"startDatetime": "startDate",
"endDatetime": "enddate",
"locations": {
"0": {
"location": "storeLocation"
}
},
"customAttributes": {
"*": {
"id": {
"PR_PRICE_RULE_PROMO": {
"@(2,valueBoolean)": "priceRulePromo"
}
}
}
},
"tiers": {
"*": {
"priceRuleAttributes": {
"*": {
"id": {
"PR_BRANCH_NAME": {
"@(2,values)": "paths.[&5].pathName"
},
"PR_TARGET_SEGMENT": {
"@(2,values)": "paths.[&5].customerCondition[].targetSegments"
}
}
}
},
"rewards": "paths[&1].calculatePrice",
"conditions": "paths[&1].conditions"
}
}
}
}
] Expected Output {
"priceRuleName" : "Members Get Tees $15",
"startDate" : "2024-06-20T00:00:00",
"enddate" : "2024-06-24T23:59:00",
"storeLocation" : 10051,
"priceRulePromo" : true,
"paths" : [ {
"pathName" : [ "MEMBERS" ],
"customerCondition" : [ {
"targetSegments" : [ "PAS_LOGGEDIN", "LOGGEDIN", "PAS_NOT_LOGGEDIN" ]
} ],
"calculatePrice" : [ {
"rewardId" : 8127,
"changeType" : 2,
"changeAmount" : 15,
"changePercent" : null,
"quantityToDiscount" : null,
"applyInd" : 2,
"rewardsMerch" : [ ]
} ],
"catalogCondition": {
"category": [
{
"include": "no",
"categoryList": [
"613631673"
]
}
],
"products": [
{
"include": "no",
"productList": [
"613631673",
"613631674"
]
},
{
"include": "yes",
"productList": [
"613631673"
]
}
]
}
}, {
"pathName" : [ "NON MEMBERS" ],
"calculatePrice" : [ {
"rewardId" : 8128,
"changeType" : 2,
"changeAmount" : 18,
"changePercent" : null,
"quantityToDiscount" : null,
"applyInd" : 2,
"rewardsMerch" : [ ]
} ],
"catalogCondition": {
"category": [
{
"include": "no",
"categoryList": [
"613631673",
"613631674"
]
}
]
}
} ]
}
... View more
Labels:
- Labels:
-
Apache NiFi