Use Extensible Flexfields in Line-Selection Rules

Use the DooSeededOrchestrationRules object to reference an orchestration process when you use an extensible flexfield in a line-selection rule.

For example, assume you must set up a rule.

  • If the order line contains a reward item, then use it when running this orchestration process step.

Here's the logic you would use.

Object

Description

Pattern

Use patterns.

  • Root: DooSeededOrchestrationRules.DOOHeader

  • header is a DooSeededOrchestrationRules.DOOHeader

  • fline is a header/childFLines

  • flineEFF is a header/childFLines/flexContexts

Test

Use tests.

  • flineEFF.context.equalsIgnoreCase("Item_Information") is DooSeededOrchestrationRules.Boolean.TRUE

  • flineEFF.getFlexAttributeValue("_Reward_Item") isn't null

Note

  • The equalsIgnoreCase function is optional if you know the absolute case of the argument.

  • The getFlexAttributeValue() function on the flexContexts object looks up the extensible flexfield value.

Action

Use an Assert New action.

  • DooSeededOrchestrationRules.Result (resultObjKey:FLine.fulfillLineId)

This logic creates a hierarchy.

Order Header
  childFLines
    flexContext

where

  • Order Header is the root

  • childFLines is a child of Order Header

  • flexContext is a child of childFLines and a grandchild of Order Header

This example uses Tree Mode to maintain the hierarchy rather than explicitly creating the hierarchy. The forward slash (/) specifies the hierarchy. For example:

  • header/childFLines/flexContexts

In this example, you will define line selection criteria in an orchestration process to specify which orchestration process steps to run for each fulfillment line. You define this criterion according to the value that an extensible flexfield contains. You create a rule.

  • If the Export Compliance status is Not Passed for an order line, then do a manual examination. Send other order lines directly to shipping.

Here's the flow you create.

flow for Using Extensible Flexfields in Line-Selection Rules

You will use an extensible flexfield to store the value of the compliance status.

Context

Extensible Flexfield

Object

Value

Compliance

Compliance_Status

Fulfillment Line EFF (DOO_FULFILL_LINES_ADD_INFO)

Not Passed

You will create a line-selection rule.

rule for Using Extensible Flexfields in Line-Selection Rules

Summary of the Steps

Fulfill order lines according to the value of an extensible flexfield.

  1. Create the rule.

  2. Establish the object hierarchy.

  3. Select lines according to flexfield context.

  4. Select lines according to compliance status.

  5. Identify the fulfillment line that requires manual examination.

For details about how to create a business rule, see Overview of Using Business Rules With Order Management.

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 Orchestration Process Definitions

  2. On the Manage Orchestration Process Definitions page, locate the orchestration process you must edit, then click Actions > Edit.

  3. On the Edit Orchestration Process Definitions page, in the Process Details area, in the Step Definition list, add a step.

    Attribute

    Value

    Step Name

    Compliance Check

    Step Type

    Service

    Task Type

    DOO_TradeCompliance

    Task

    DOO_TradeCompliance

    Service

    Request Screening for Trade Compliance

  4. In the row you just added, in the Line-Selection Criteria column, click Click for Rule.

  5. In the Line-Selection Criteria dialog, click Add Rule > Properties, then set the values.

    Attribute

    Value

    Name

    Examine Compliance Status

    Description

    If the Export Compliance status is Not Passed for an order line, then perform a manual examination.

    Effective Date

    Always

    Priority

    Medium

    Active

    Contains a check mark.

    Advanced Mode

    Contains a check mark.

    Tree Mode

    Contains a check mark.

    Use tree mode so you can include an extensible flexfield in the root hierarchy of an orchestration rule.

  6. Set the root.

    Attribute

    Value

    Root

    DooSeededOrchestrationRules.DOOHeader

Establish the Object Hierarchy

You must establish an object hierarchy so the rule filters the data it processes.

Order Header
  childFLines
    flexContexts

where

  • Order Header is the root

  • childFLines is a child of Order Header

  • flexContexts is a child of childFLines and a grandchild of Order Header

This example uses Tree Mode to maintain the hierarchy rather than explicitly creating the hierarchy. Each forward slash (/) specifies a hierarchy level.

header/childFLines/flexContexts

where

  • header is the root. The root makes sure the rule processes data only in the child object that references the root.

  • childFLines is the child. The child makes sure the rule processes data only in the grandchild object that references the child.

  • flexContexts is the grandchild.

You will create an If statement. It establishes the object hierarchy.

statement that establishes the object hierarchy

Establish the object hierarchy.

  1. In the If area, delete the value in the field to the left of Is A, and then enter this value.

    Attribute

    Value

    Field to the left of Is A

    Header

  2. In the field to the right of Is A, set the value.

    Attribute

    Value

    Field to the right of Is A

    DooSeededOrchestrationRules.DOOHeader

  3. Under the field that contains header, add a check mark to the option that selects the test, click Cut > Cut.

    For example:

    copying the test in the rule

    The hierarchy includes the extensible flexfield variables, so its not necessary to include tests when you define the hierarchy.

  4. Click Add Pattern.

  5. In the field to the left of Is A, enter the value.

    Attribute

    Value

    Field to the left of Is A

    Fline

  6. In the field to the right of Is A, set the value.

    Attribute

    Value

    Field to the right of Is A

    header/childFLines

  7. Click Add Pattern.

  8. In the field to the left of Is A, enter the value.

    Attribute

    Value

    Field to the left of Is A

    FlineEFF

  9. In the field to the right of Is A, set the value.

    Attribute

    Value

    Field to the right of Is A

    header/childFLines/flexContexts

Select Lines According to Flexfield Context

You will add a test.

  • If the flexfield context is Compliance

This text will select lines only where the flexfield context is Compliance.

You will create an expression.

Left Expression

Operand

Right Expression

FLineEFF.context.equalsIgnoreCase("Compliance")

Is

DooSeededOrchestrationRules.Boolean.TRUE

Select lines according to flexfield context.

  1. Under the pattern you just added, click Add Test.

    You will add the test criteria that identifies fulfillment lines that proceed through compliance testing. If the attributes you reference are optional, then you include null value checks to avoid a null pointer exception at run time.

  2. Click Left Value.

  3. In the Condition Browser, click Expression Builder.

  4. In the Expression Builder, click Functions, expand FLineEFF > Context, click equalsIgnoreCase(String), then click Insert Into Expression.

    For example:

    expanding the folders until you can view the functions of the context object

    To navigate the tree structure, expand the folders until you can view the functions of the context object. FlineEFF is the pattern you declared earlier.

    The context you expand is a fact in the FlineEFF pattern. It includes functions you can use to perform a variety of calculations. Therefore, the expression you create includes the pattern, fact, and function.

  5. In the window near the top of the dialog, replace the word String with the context for your extensible flexfield condition. In this example, replace String with Compliance.

    For example:

    defining context for your extensible flexfield condition
  6. Click OK > OK.

  7. Click Right Value.

  8. In the Condition Browser, expand DooSeededOrchestrationRules > Boolean, then click TRUE > OK.

    For example:

    setting boolean value in browser

Select Lines According to Compliance Status

You will add a test.

  • If the value of the flexfield attribute named Compliance Status is Not Passed

You will create an expression.

Left Expression

Operand

Right Expression

flineEFF.getFlexAttributeValue("_Compliance_Status")

Is

"Not Passed "

Select lines according to Compliance Status.

  1. In the test you just added, immediately to the right of the Right Value magnifying glass, click the down arrow, then click Simple Test.

  2. Click Left Value.

  3. In the Condition Browser, click Expression Builder.

  4. In the Expression Builder, click Functions, click FlineEFF.getFlexAttributeValue(String), then click Insert Into Expression.

    For example:

    Selecting lines according to Compliance Status
  5. In the window near the top of the dialog, replace the word String with the name of the flexfield attribute.

    You must use an underscore to prefix the attribute name in a function. The attribute name is Compliance_Status, so you use _Compliance_Status.

    For example:

    adding status in expression
  6. Click OK > OK.

  7. In the field to the right of Is, enter "Not Passed".

    You must include the double quotation marks ( " ).

    Make sure your rule contains tests.

    Left Expression

    Operand

    Right Expression

    FLineEFF.context.equalsIgnoreCase("Compliance")

    Is

    DooSeededOrchestrationRules.Boolean.TRUE

    flineEFF.getFlexAttributeValue("_Compliance_Status")

    is

    "Not Passed"

Identify the Fulfillment Line That Requires Manual Examination

You will create a statement.

Identifying the Fulfillment Line That Requires Manual Examination

where

  • Result is a fact in the DooSeededOrchestrationRules dictionary.

  • resultObjKey is a property of the Result fact.

  • resultObjKey stores the value that this rule uses to identify the fulfillment line that requires manual examination.

  • Fline is a fact in the DooSeededOrchestrationRules dictionary that contains fulfillment line attributes.

  • fulfillLineID is a fulfillment line attribute.

Identify the fulfillment line that requires manual examination.

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

  2. Click Select a Target > DooSeededOrchestrationRules.Result.

  3. Click Edit Properties.

  4. In the Properties dialog, in the resultObjKey row, click Value.

  5. In the Condition Browser, expand Fline, click fulfillLineID, then click OK.

  6. Make sure the Properties dialog looks like this:

    using the Properties dialog
  7. Click OK

  8. In the Line-Selection Criteria dialog, click Save.

  9. On the Edit Orchestration Process Definition page, click Save.