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.
|
Test |
Use tests.
Note
|
Action |
Use an Assert New action.
|
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.
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.
Summary of the Steps
Fulfill order lines according to the value of an extensible flexfield.
-
Create the rule.
-
Establish the object hierarchy.
-
Select lines according to flexfield context.
-
Select lines according to compliance status.
-
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
-
Go to the Setup and Maintenance work area, then go to the task:
-
Offering: Order Management
-
Functional Area: Orders
-
Task: Manage Orchestration Process Definitions
-
-
On the Manage Orchestration Process Definitions page, locate the orchestration process you must edit, then click Actions > Edit.
-
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
-
In the row you just added, in the Line-Selection Criteria column, click Click for Rule.
-
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.
-
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.
Establish the object hierarchy.
-
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
-
In the field to the right of Is A, set the value.
Attribute
Value
Field to the right of Is A
DooSeededOrchestrationRules.DOOHeader
-
Under the field that contains
header
, add a check mark to the option that selects the test, click Cut > Cut.For example:
The hierarchy includes the extensible flexfield variables, so its not necessary to include tests when you define the hierarchy.
-
Click Add Pattern.
-
In the field to the left of Is A, enter the value.
Attribute
Value
Field to the left of Is A
Fline
-
In the field to the right of Is A, set the value.
Attribute
Value
Field to the right of Is A
header/childFLines
-
Click Add Pattern.
-
In the field to the left of Is A, enter the value.
Attribute
Value
Field to the left of Is A
FlineEFF
-
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.
-
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.
-
Click Left Value.
-
In the Condition Browser, click Expression Builder.
-
In the Expression Builder, click Functions, expand FLineEFF > Context, click equalsIgnoreCase(String), then click Insert Into Expression.
For example:
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.
-
In the window near the top of the dialog, replace the word
String
with the context for your extensible flexfield condition. In this example, replaceString
withCompliance
.For example:
-
Click OK > OK.
-
Click Right Value.
-
In the Condition Browser, expand DooSeededOrchestrationRules > Boolean, then click TRUE > OK.
For example:
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.
-
In the test you just added, immediately to the right of the Right Value magnifying glass, click the down arrow, then click Simple Test.
-
Click Left Value.
-
In the Condition Browser, click Expression Builder.
-
In the Expression Builder, click Functions, click FlineEFF.getFlexAttributeValue(String), then click Insert Into Expression.
For example:
-
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:
-
Click OK > OK.
-
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.
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.
-
In the Then area, click Add Action > Assert New.
-
Click Select a Target > DooSeededOrchestrationRules.Result.
-
Click Edit Properties.
-
In the Properties dialog, in the resultObjKey row, click Value.
-
In the Condition Browser, expand
Fline
, click fulfillLineID, then click OK. -
Make sure the Properties dialog looks like this:
-
Click OK
-
In the Line-Selection Criteria dialog, click Save.
-
On the Edit Orchestration Process Definition page, click Save.