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.

advanced 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

  1. Create the rule.

  2. Create the first IF statement.

  3. Create the second IF statement.

  4. Create the third IF statement.

  5. Create the fourth IF statement.

  6. Create the THEN statement.

This topic uses example values. You might need different values, depending on your business requirements.

Create the Rule

  1. Go to the Setup and Maintenance work area, then go to the task.

    • Offering: Order Management

    • Functional Area: Orders

    • Task: Manage Product Transformation Rules

  2. On the Manage Product Transformation Rules page, click Advanced.
  3. 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.

  4. Click Save > Save.

  5. 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.

The First IF Statement

Try it.

  1. In the field to the left of Is A, enter FulfillLine.

  2. In the field to the right of Is A, click the down arrow, then click OrderTransformationRules.FulfillLineVO.

  3. Click Add Test > Simple Test.

  4. Click Left Value.

  5. In the Condition Browser, expand FulfillLine, then click DeltaType > OK.

  6. In the Right Value attribute, enter "Add". You must include the double quotation marks.

  7. Click Save.

Create the Second IF Statement

You will create this IF statement. It determines whether the change in fulfillment line 2 is Delete.

the Second IF Statement

Try it.

  1. Click Add Pattern.

  2. In the window below And, enter FulfillLine2.

  3. In the field to the right of Is A, click the down arrow, then click OrderTransformationRules.FulfillLineVO.

  4. Click Add Test > Simple Test, then click Left Value.

  5. In the Condition Browser, expand FulfillLine2, then click DeltaType > OK.

  6. 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

the Third IF Statement

Try it.

  1. Click Add Pattern.

  2. In the window below And, enter FulfillLine.

  3. In the field to the right of Is A, click the down arrow, then click OrderTransformationRules.FulfillLineVO.

  4. Click Add Test > Simple Test, then click Left Value.

  5. In the Condition Browser, expand FulfillLine, click InventoryItemId, then click OK.

  6. Click Right Value.

  7. 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.

the Fourth IF Statement

Try it.

  1. Click Add Pattern.

  2. In the window below And, enter FulfillLine.

  3. In the field to the right of Is A, click the down arrow, then click OrderTransformationRules.FulfillLineVO.

  4. Click Add Test > Simple Test, then click Left Value.

  5. In the Condition Browser, expand FulfillLine, then click InventoryItemId > OK.

  6. Click Is > Isn't.

  7. Click Right Value.

  8. 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.

the Then Statement

Try it.

  1. In the Then area, click Add Action > Assert New.

  2. Click Select a Target, then click OrderTransformationRules.DeleteOrderLine.

  3. Click Edit Properties.

  4. In the Properties dialog, enter values, then click OK

    Name

    Value

    fulfillmentLineId

    fulfillmentLineId

    viewRowImpl

    fulfillmentLineId

  5. Click Add Action > Retract.

  6. Click Select a Target, then click FulfillLine2.

    Click Save.