Below are the high-level steps to configure the Order Fulfillment (Shipment) Flow :
- Configure Process Scheduler to retrieve fulfillment results from AMP for the feeds submitted.
- Define the transformation steps needed to convert the Amazon Feed Result Payload to the file format as per the ERP requirements.
- Integrate with the ERP system to send the transformed feed result to ERP.
- Configure Routes & Business Processes used to transform and send the feed result to ERP.
See below for detailed steps.
Setting up Resources for the Customer ERP
- Create a package in the ERP project (Configure the Customer ERP Project) to add the objects with reference to the fulfillment result flow. Recommended package name: com.cleo._customer_.erpname.feedResult.
- Create a BP in this package to update the fulfillment result (obtained from AMP) to the ERP, if required. A Business Process (UpdateSampleFFFeedResultBPS) is provided in the sample project for reference. This BP can provide the status code to the ERP as a payload (in flat-file format ).
- Configure the MANIFEST.MF file.
- Open the MANIFEST.MF file located in the META-INF folder.
- Go to the ‘Runtime’ tab and add the package just created.
- Close and save the MANIFEST.MF file.
Setting up Resources for the AMP ERP Intersection Project
- Create a package in the intersection Project (See Configure AMP and ERP Intersection Project) whic will be used to add objects with reference to the fulfillment result flow.
Recommended package name is com.cleo._customer_.amp.erpname.feedResult.
Process Schedulers
- Create a new Proccess Scheduler in the feedResult package and configure the BP - com.cleo._customer_.booster.amp.feedResult.LaunchAmpFeedResultBPS.
- Set the recurrence as per speficic requirements. A sample Schedule (LaunchAMPFeedResultPS) has been provided as reference in the sample project, com.cleo._customer_.amp.sample.ampff.
- Close and save your changes.
Note: A minimum 15-minute time interval is recommended to process the CreateFeed API and GetFeed API and hence, the processes - ERP Booster Fulfillment Launcher (the Route BP created in Setting up Resources for AMP ERP Intersection Project in Order Fulfillment Flow. ) LaunchAmpFeedResultBPS must be set with a minimum interval of 15 minutes time gap.
Related topic: Creating and Defining Process Schedules
Transformation Ruleset
- Create a Schema (based on ERP type) to update the shipment processing result.
- Create a new Ruleset using the following XML schema (com.cleo.cic.connector.amp.xsd.AmazonEnvelopeOBJ) as source and the target schema created above in Step 1. The AmpFeedResultToSampleFFRS has been made available as reference.
In case the processing status of the fulfillment result is CANCELLED / FATAL, the response would be of type JSON, and hence another ruleset is required to parse this payload.
- Create a new Ruleset with the source schema (com.cleo.cic.connector.amp.feeds.GetFeedResponse) and the target schema created in Step 1. The AmpCancelledFeedResultToSampleFFRS Ruleset is available as a reference.
Note: The purpose of the above created rulesets are to have the raw data visibility in the cockpit with source as AMP feed result XML and target data containing ShipmentID.
- It is mandatory to map process environment variable envLomId to environment variable Log_of_Message_Id. A sample Ruleset snippet is shown below for reference.
- Close and save the Ruleset.
Route Business Process
- Copy the AmpFeedResultSuccessCockpitBPS Business Process from the sample project (package - com.cleo._customer_.amp.sample.ampff.feedResult) and paste it in the com.cleo._customer_.erpname.feedResult package created eariler.
- Delete the UpdateSampleFFFeedResultBPS task that displays as an error (as it referred to the sample project) and add the BP created in Setting up Resources for the Customer ERP.
- Copy the AmpFeedResultErrorCockpitBPS from the sample project (package - com.cleo._customer_.amp.sample.ampff.feedResult ) and paste it in the package com.cleo._customer_.amp.sample.ampff.feedResult
- Delete the UpdateSampleFFFeedResultBPS task that shows up as an error (as it referred to the sample project) and add the BP created in Step 2 of the Setting up Resources for Customer ERP section).
- Copy AmpFeedResultRejectedCockpitBPS from the sample project (package - com.cleo._customer_.amp.sample.ampff.feedResult) and paste it in the package, com.cleo._customer_.amp.sample.ampff.feedResult.
- Delete the UpdateSampleFFFeedResultBPS task that shows up as an error (as it referred to the sample project) and add the BP created in Step 2 of the Setting up Resources for Customer ERP section).
- Copy AmpFeedResultCockpitBPS from the sample project (Package - com.cleo._customer_.amp.sample.ampff.feedResult ) and paste it in the package, com.cleo._customer_.amp.sample.ampff.feedResult.
- Delete the AmpFeedResultSuccessCockpitBPS and AmpFeedResultErrorCockpitBPS tasks that shows up as an error (as they referred to the sample project) and add a step to call AmpFeedResultSuccessCockpitBPS and AmpFeedResultErrorCockpitBPS which was copied in steps 1 and 2 above.
Label Task Parameters Pass Fail AmpFeedResultSuccessCockpitBPS sourceContext : sourceContext,
shipmentId : shipmentId,
inputDataFragment : inputDataFragment,
cockpitRuleset : cockpitRuleset,
feedSubmissionId : feedSubmissionId,
targetContext : targetContext,
transformationRuleset : transformationRuleset
Success Failure Error AmpFeedResultErrorCockpitBPS sourceContext : sourceContext,
shipmentId : shipmentId,
inputDataFragment : inputDataFragment,
cockpitRuleset : cockpitRuleset,
feedSubmissionId : feedSubmissionId,
targetContext : targetContext,
transformationRuleset : transformationRuleset
FailureExit Failure - Copy ProcessAmpFeedResultFailureBPS from the sample project (Package - com.cleo._customer_.amp.sample.ampff.feedResult) and paste it in the package (com.cleo._customer_.amp.sample.ampff.feedResult).
- Delete the AmpFeedRejectedCockpitBPS task that shows up as an error (it refers to the sample project) and add the step inside the for loop and call AmpFeedResultRejectedCockpitBPS (copied in step 3 above).
Task Parameter AmpFeedResultRejectedCockpitBPS sourceContext : sourceContext,
shipmentId : v_shipmentId,
inputDataFragment : inputDataFragment,
cockpitRuleset : cockpitRuleset,
feedSubmissionId : feedSubmissionId,
targetContext : targetContext,
transformationRuleset : transformationRuleset,
status : Rejected
- Copy the RouteSampleAmpFFFeedResultBPS from the sample project (Package - com.cleo._customer_.amp.sample.ampff.feedResult ), paste it in the package ( com.cleo._customer_.amp.sample.ampff.feedResult) and rename this object as per requirement.
The variable v_cancelledTransformationRuleset would show up as an error (refers to the sample project). Hence, initialize this variable with the value ( i.e the ruleset ) created above in the Ruleset section.
- Delete the AmpFeedResultSuccessCockpitBPS task that shows up as an error (it refers to sample project) and add a step in for loop to call AmpFeedResultSuccessCockpitBPS (copied in step 1).
Task Parameter AmpFeedResultSuccessCockpitBPS sourceContext : context,
shipmentId : v_shipmentId,
inputDataFragment : inputDataFragment,
cockpitRuleset : cockpitRuleset,
feedSubmissionId : v_feedSubmissionId,
targetContext : v_targetContext,
transformationRuleset : transformationRuleset
- Delete the AmpFeedResultCockpitBPS task that shows up as an error (refers to sample project) and add a step in for loop to call AmpFeedResultCockpitBPS which was copied in step 4 above.
Task Parameter AmpFeedResultCockpitBPS shipmentId : v_shipmentId,
inputDataFragment : inputDataFragment,
sourceContext : context,
cockpitRuleset : cockpitRuleset,
feedSubmissionId : v_feedSubmissionId,
resultList : v_resultList,
targetContext : v_targetContext,
transformationRuleset : transformationRuleset
- Delete the two steps referring to ProcessAmpFeedResultFailureBPS tasks that show up as an error (refers to sample project) and add two steps to call ProcessAmpFeedResultFailureBPS which was copied in step 5 above.
Label Task Parameters Pass Fail ProcessAmpFeedResultFailureBPS resultDescription : v_cancelledResultDescription,
shipmentIdList : v_shipmentIdList,
sourceContext : context,
inputDataFragment : inputDataFragment,
transformationRuleset : transformationRuleset,
targetContext : v_targetContext,
feedSubmissionId : v_feedSubmissionId,
cockpitRuleset : cockpitRuleset,
statusCode : v_statusCode
FailureExit Failure HandleCancelledStatus ProcessAmpFeedResultFailureBPS resultDescription : v_cancelledResultDescription,
shipmentIdList : v_shipmentIdList,
sourceContext : context,
inputDataFragment : inputDataFragment,
transformationRuleset : v_cancelledTransformationRuleset,
targetContext : v_targetContext,
feedSubmissionId : v_feedSubmissionId,
cockpitRuleset : v_cancelledCockpitRuleset,
statusCode : v_processingStatus
FailureExit Failure - Close and save.
Configure Application Route
Create a new application route object with Application Matching Parent com.cleo._customer_.booster.amp.AmpAI and parameters DocType-FeedResult and SourceApp - AMP , Route BPs created in (Step 6 of Route BP section above), with Fields -
- transformationRuleset = ruleset created in the configure Ruleset section above.
- cockpitRuleset = com.cleo._customer_.booster.amp.feedResult.AmpFeedResultCockpitRS
The Application Route AmpSampleFFFeedResultRouteAR, located in the com.cleo._customer_.amp.sample.ampff.feedResult package has been configured to route the Amazon Feed Results to a File System ERP.
Save all changes and close the object.
Final step
Once all resources have been added to the feedResult package of the AMP ERP Intersection Project, open Intersection Project's MANIFEST.MF file (under the META-INF folder) and go to the Runtime tab. Add the package (com.cleo._customer_.amp.erpname.feedResult).
Close and save the MANIFEST.MF file.
Related Topic
How to Run the Order Fulfillment Flow (including deployment steps)
Comments
0 comments
Please sign in to leave a comment.