The process orchestration takes FlatFile as input and translates it to the payload of type JSON AdjustInventoryLevelRequest/ SetInventoryLevelRequest and sends the same to Shopify. Once the request is submitted to Shopify, inventory quantity sync will be done for the specific inventory item id.
The process orchestration logic has been configured to perform the following operations:
- Receive the FlatFile and translate it to AdjustInventoryLevelRequest/SetInventoryLevelRequest JSON payload.
- Submit the payload to Shopify with the correct APIs.
Configure the Inventory Sync Flow
Below are the high-level steps to configure the Inventory Sync Flow:
- Configure the objects to retrieve inventory payload from ERP. Create the DARS and Launcher BPS.
- Create the App Route to route the payload to Shopify.
- Create the transformation ruleset with the required mapping to convert the ERP inventory payload to the Shopify inventory JSON.
Guidelines for each configuration step are described here.
- Create a package in the ERP project (see Project Configuration (ERP, Intersection Projects)) to add the objects with reference to the inventory flow. Recommended package name is com.cleo._customer_.erpname.
- Copy the Application Interface (SampleShopifyFFAI) that is in com.cleo._customer_.booster.sample.shopifyff, and paste it to the package created above. It should be renamed to match the target ERP and file format type (For example ShopifyErpnameAI.appInterface.
If more attributes are required, then add them here accordingly.
- Create a package in the ERP project (see Project Configuration (ERP, Intersection Projects)) to add the objects with reference to the inventory flow. Recommended package name is com.cleo._customer_.erpname.simpleItemInventory/kitItemInventory/ItemgroupInventory.
If the ERP has different types of items (Kit, ItemGroups, Simple items,etc) then name the Inventory package to something that reflects the actual item type.
- Create the following objects in this package (Schema, DARS, launch BP):
a) Schema: Create the Schema for the required type per your ERP. A sample schema has been provided in the sample project for different inventory item types:
These are in the package com.cleo._customer_.booster.sample.shopifyff.inventory.simpleItemInventory, com.cleo._customer_.booster.sample.shopifyff.inventory.kitItemInventory and com.cleo._customer_.booster.sample.shopifyff.inventory.itemGroupInventory respectively.
b) Data Analysis Ruleset (DARS): Using the Schema created above as the source, create the DARS Ruleset. See the SampleFFSimpleItemInventoryDARS.ruleset in the com.cleo._customer_.booster.sample.shopifyff.inventory.simpleItemInventory package.
Also refer to SampleFFItemGroupInventoryDARS and SampleFFKitInventoryDARS for Item group and Kit inventory level Ruleset configuration.
c) Launch Business Process: Create a BP with template - No Template. Refer to LaunchSampleFFSimpleInventoryBPS in com.cleo._customer_.booster.sample.shopifyff.inventory.simpleItemInventory package.
Similarly, launcher BPs can be created for item group and kit item types. The configuration steps that follow are for simple item types:
The first task in the BP is to retrieve the shipment payload from your ERP.
If your integration is file-based, then you'll need to create an endpoint for that required type. See Managing-Endpoints for more information.
- Next you will need to create a dataflow with the source being the endpoint you just created. The target is the transformation endpoint. For reference, see theSampleFFSimpleInventory.event (in the com.cleo._customer_.booster.sample.shopifyff package). This triggers the LaunchSampleFFSimpleInventoryBPS.bps.
- A similar event should be created by the user; the Launch BP must be called by this Event.
For non file-based integrations, configure your necessary objects (WSC, WSP, Adapter/Connector calls to retrieve the data).
- Create a task to call the DARS that you created above.
- Open the Project's MANIFEST.MF file. From the Runtime tab, add the new packages created above. From the Dependencies tab, add com.cleo.b2bcloud.core
Configure the Shopify ERP Intersection Project
- Open MANIFEST.MF file. Go to the Dependencies tab and add the dependent projects shown in the image below.
- Create a package in the intersection project (see Project Configuration (ERP, Intersection Projects)) to add the objects with reference to the inventory sync flow. These include a Ruleset, route BP, and Application Route.
Recommended package name: com.cleo._customer_.shopify.erpname.simple.inventory.
a) Ruleset: Create a new transformation Ruleset. Use the schema created above as source; use a JSON schema as target. The JSON schema to be used is com.cleo.cic.connector.shopify.orders.AdjustInventoryLevelRequest.jsonSchema or SetInventoryLevelRequest.jsonSchema
It is mandatory that you map the process environment variable envLomId to the environment variable Log_of_Message_Id (shown below).
In the Ruleset, add a rule ProcessEnvironment_GetStringValueActionand add a source property value as a hardcoded string valueenvLomId, and set the target as environment variable env.Log_of_Message_Id. This is required for CIC Cockpit tile creation and should ideally be the first rule in the Ruleset. Save all changes.
Example Ruleset: The SampleFFInventoryToShopifyInventoryRS.ruleset is located in the com.cleo._customer_.shopify.sample.shopifyff.simple.inventory package, and has been configured to convert Flat File(CSV) file to Shopify Inventory (as an example).
b) FindShopifySkuInventoryRS.ruleset: Create a new ruleset with source schema created above and a target JSON schema. The target schema to be used is com.cleo.cic.connector.shopify.orders.AdjustInventoryLevelRequest.jsonSchema or SetInventoryLevelRequest.jsonSchema.
This Ruleset checks if a particular SKU id (present in source inventory ERP data) exists in a particular Shopify store or not. If yes, then the environment variable envSkuExistsInStore is set to true.
Refer to the sample ruleset FindShopifySkuInventoryRS.ruleset in com.cleo._customer_.shopify.sample.shopifyff.simple.inventory. The same flag is used later in route BP.
It is mandatory to map the process environment variable envLomId to the environmental variable Log_of_Message_Id. In the Ruleset, add a rule ProcessEnvironment_GetStringValueAction and add source property value as hardcoded string value 'envLomId; set target as environmental variable env.Log_of_Message_Id. This is required for CIC Cockpit tile creation and should ideally be the first rule in the Ruleset. Save all changes.
c) Route BP: Copy and paste the RouteSampleFFShopifySimpleInventoryBPS.bps residing in the sample Intersection project com.cleo._customer_.shopify.sample.shopifyff.simple.inventory and rename it as RouteERPSimpleInventoryBPS. This BP has been supplied with all the necessary logic to process this payload further; the payload is translated to a Shopify-supported format.
Open the route BP using the text editor and update the call to FindShopifySkuInventoryRS.ruleset using the Ruleset created in the previous step (as part of the new intersection project).
d) Application Route: Create a new Application Route object with the Application Matching Parent previously created (see Configure ERP Objects, above) using these parameters:
- DocType as the document name
- Target as Shopify
- SourceApp as the ERP (same values should be configured in DARS previously created in Configure ERP Objects, above).
In the sample, DocTypeis configured as Inventory in DARS and Application Route. If new attributes were added in the Application Interface object, then configure the values accordingly. The Route BP (RouteFFShopifySimpleInventoryBPS)created in step (c) above needs to be configured with these two fields:
transformationRuleset = the Ruleset created in the section above.
Example Application Route: SampleFFShopifySimpleInventoryRouteAR is in the com.cleo._customer_.shopify.sample.shopifyff.simple.inventory package and has been configured to route the file from a File System ERP to Shopify.
- Set Dependency for package created in Step 2.
Open MANIFEST.MF file. Go to the Runtime tab and add the new package.
Similar steps should be followed if the customer ERP has inventory items of different types (for example, Item group or Kit package, etc.
Package names that can be used for reference are highlighted below.
Please sign in to leave a comment.