Constraint formulas inside <definition> tags define where and when exceptions occur. Use “assert once” to report exceptions at the beginning of each consecutive time period, “assert” to report exceptions on every occurrence, and “assert leading” to report exceptions on the first occurrence.
The following is an example of a Part_Shortage constraint. The constraint formula inside the <definition> tags defines the exception in the context of “Ending Inventory Units” at a weekly level. The formula defines to not report an exception if the current part is a finished good, or if the current location is in the past, or if the current quarter is in the future or the past, or if there is a positive quantity in “Ending Inventory Units.” The phrase “assert once” defines to report exceptions at the beginning of each consecutive time period.
<Constraint name=”Parts_Shortage” cibe=”Supply” description=”Parts shortage exists based on current demand” measure=”Ending inventory Units” owner=”mfg_ops” dueDate=”P2D” priority=”High” type=”Shortage”> <Definition><![CDATA[ Parts_Shortage.”Ending Inventory Units”[level(Week)] assert once(ComponentMetrics.isFinishedGood or is Past() or not isCurrent(parent(parent(“Ending Inventory Units”, Manufacturing), Manufacturing)) or “Ending Inventory Units”<=0) ]]<>/Definition> <Context> <Value name="Part" type="string" length="100">ComponentMetrics.part="Part"</Value> <Value name="Location" type="string" length="100">ComponentMetrics.location</Value> <Value name="EndingInventoryUnits" displayName="Ending Inventory Units" type="number"> "Ending Inventory Units"</Value> <Value name="TotalDemandUnits" displayName="Total Demand Units" type="number"> "Total Demand Units</Value> </Context> </Constraint>
The expressions inside the Context tags specify what data need to be captured when an exception occurs.