I need to create a product specification that includes dependencies between order components based on a data change notification wait condition
How do I define the XQuery expression in the "Data Change Condition Expression" field?
Specifically, I have 4 order components in the product specification that are independent of each other but each order component can only start when a specific data element has a certain value. The data element is at the order level and is not available as an order line item property.
I would appreciate if someone from Oracle can provide a more detailed explanation of the fields in the "Product Specification Editor Dependencies Subtab" ->"Wait Condition subtab"
Data Change Condition Expression
Provide two pieces of information:
1. Order Item Property
2. Boolean XQuery expression returning fn:true() to fire the dependency.
Assume you need to ensure all Provisioining items (From) must have reached the "PRODUCT STARTED" milestone , before the Billing Component Items (To) can start.
Note From Component is also known as "blocking" while the To Component is known as "Waiter"
1. Data Change Notification property: milestone
2. Data Change Condition Expression Xquery:
declare variable $blockingIndexes as xs:integer* external; (: list of From component items - index :)
let $expectedMilestoneCode := "PROVISION STARTED"
(: extract milestones values from all provisioning function items matching the expected milestone value , only for the given From component :)
let $milestoneValues := /GetOrder.Response/_root/ControlData/Functions/ProvisioningFunction/orderItem/orderItemRef[fn:index-of($blockingIndexes, xs:integer(@referencedIndex)) != 0]/milestone[text() eq $expectedMilestoneCode]
(: Return true only if ALL the milestones in the From component (ProvisioningFunction/orderItem/orderItemRef) are PROVISION STARTED :)
return fn:count($milestoneValues) eq fn:count($blockingIndexes)