Create Advanced Transformation Rules
Create an advanced transformation rule that compares two or more lines in a source order.
Assume a fulfillment line adds an inventory item, but then another fulfillment line deletes the same inventory item. You can create a transformation rule that avoids processing these lines.
-
If fulfillment line a requests to add inventory item x, and if fulfillment line b requests to delete inventory item x, then delete fulfillment lines a and b
You will implement this logic.
Statement |
Description |
---|---|
First IF statement |
If the change on fulfillment line 1 is Add. |
Second IF statement |
If the change on fulfillment line 2 is Delete. |
Third IF statement |
If the inventory item on fulfillment line 1 is the same as the inventory item on fulfillment line 2. |
Fourth IF statement |
If the fulfillment line ID on fulfillment line 1 is different from the fulfillment ID on fulfillment line 2. |
THEN statement |
Delete fulfillment line 1 and fulfillment line 2. |
You will create this transformation rule.
This topic uses Advanced Mode. We strongly recommend that you familiarize yourself with this mode and with creating business rules. For details, see Overview of Using Business Rules With Order Management.
Summary of the Set Up
-
Create the rule.
-
Create the first IF statement.
-
Create the second IF statement.
-
Create the third IF statement.
-
Create the fourth IF statement.
-
Create the THEN statement.
This topic uses example values. You might need different values, depending on your business requirements.
Create the Rule
-
Go to the Setup and Maintenance work area, then go to the task:
-
Offering: Order Management
-
Functional Area: Orders
-
Task: Manage Product Transformation Rules
-
- On the Manage Product Transformation Rules page, click Advanced.
-
Click Properties, then set the values.
Attribute
Value
Rule 1
Consolidate Add and Delete Actions
Description
Rule that removes requests that cancel each other.
Advanced Mode
Contains a check mark.
-
Click Save > Save.
- Click Add > Add Rule.
Create the First IF Statement
You will create this IF statement. It determines whether the change in fulfillment line 1 is Add.
Try it.
-
In the field to the left of
Is A
, enterFulfillLine
. -
In the field to the right of
Is A
, click the down arrow, then click OrderTransformationRules.FulfillLineVO. -
Click Add Test > Simple Test.
-
Click Left Value.
-
In the Condition Browser, expand FulfillLine, then click DeltaType > OK.
-
In the Right Value attribute, enter
"Add"
. You must include the double quotation marks. -
Click Save.
Create the Second IF Statement
You will create this IF statement. It determines whether the change in fulfillment line 2 is Delete.
Try it.
-
Click Add Pattern.
-
In the window below
And
, enterFulfillLine2
. -
In the field to the right of
Is A
, click the down arrow, then click OrderTransformationRules.FulfillLineVO. -
Click Add Test > Simple Test, then click Left Value.
-
In the Condition Browser, expand
FulfillLine2
, then click DeltaType > OK. -
In the attribute Right Value, enter
"Delete"
. You must include the double quotation marks.Click Save.
Create the Third IF Statement
You will create this IF statement. It determines whether the inventory item in fulfillment line 1 is the same as the inventory item in fulfillment line 2
Try it.
-
Click Add Pattern.
-
In the window below
And
, enterFulfillLine
. -
In the field to the right of
Is A
, click the down arrow, then click OrderTransformationRules.FulfillLineVO. -
Click Add Test > Simple Test, then click Left Value.
-
In the Condition Browser, expand FulfillLine, click InventoryItemId, then click OK.
-
Click Right Value.
-
In the Condition Browser, expand
FulfillLine2
, then click InventoryItemId > OK.Click Save.
Create the Fourth IF Statement
You will create this IF statement. It determines whether the fulfillment line ID of fulfillment line 1 is different from the fulfillment ID of fulfillment line 2.
Try it.
-
Click Add Pattern.
-
In the window below
And
, enterFulfillLine
. -
In the field to the right of
Is A
, click the down arrow, then click OrderTransformationRules.FulfillLineVO. -
Click Add Test > Simple Test, then click Left Value.
-
In the Condition Browser, expand FulfillLine, then click InventoryItemId > OK.
-
Click Is > Isn't.
-
Click Right Value.
-
In the Condition Browser, expand
FulfillLine2
, click InventoryItemId > OK.Click Save.
Create the Then Statement
You will create this action. It deletes fulfillment line 1 and fulfillment line 2.
Try it.
-
In the Then area, click Add Action > Assert New.
-
Click Select a Target, then click OrderTransformationRules.DeleteOrderLine.
-
Click Edit Properties.
-
In the Properties dialog, enter values, then click OK
Name
Value
fulfillmentLineId
fulfillmentLineId
viewRowImpl
fulfillmentLineId
-
Click Add Action > Retract.
-
Click Select a Target, then click
FulfillLine2
.Click Save.