Scrap Limit Threshold Violation#
Overview#
The Scrap Limit Threshold Violation feature evaluates accumulated scrap whenever a Record Loss operation is performed. Quality Engineers and Managers can configure limits for individual Materials, Production Orders, or Manufacturer Lot Numbers, and define actions to perform when those limits are exceeded.
The available actions are Hold, Open Protocol, Rule, and Notification. Multiple actions can be configured for the same threshold.
Concept#
Each threshold defines:
- Context — Where the configuration applies, such as a Product, Product Group, Flow, Step, Resource, or Loss Reason.
- Grouping — Whether losses are accumulated for one Material or across Materials in a Production Order or Manufacturer Lot Number.
- Limit scope — Whether losses are counted together or separately for each Step, Resource, Flow, Loss Reason, or supported combination.
- Threshold — The maximum accepted scrap quantity or percentage.
- Actions — The response when accumulated scrap first exceeds the threshold.
Note
The threshold represents the maximum accepted loss. A violation occurs only when accumulated scrap is greater than the threshold. For example, an Absolute threshold of 10 permits a total loss of 10 units; the next unit causes a violation.
Enabling Scrap Limit Evaluation#
Set the configuration entry /MedDev/ScrapLimitViolation/Enable to true. Its default value is false.
When enabled, the feature records losses in the MedDevScrapLimitRecordLossLogs Generic Table and evaluates the applicable thresholds in the MedDevScrapLimitViolationContext Smart Table.
For Percentage limits, Materials must have a valid MedDevLotOriginalQuantity attribute. The feature maintains this attribute during Material creation, cloning, splitting, and merging while enabled. See Original Quantity for details.
Setting up Scrap Limits#
Open the MedDevScrapLimitViolationContext Smart Table, displayed in MES as Med Dev Scrap Limit Violation Context.
The table displays the context columns first, followed by the limit settings and action columns. The Step, Product, and Product Group filters above the table help you find existing configurations. Select Add to create a configuration row, then complete the fields described below.
The guide uses the column names from the table definition. In MES, these names are displayed with spaces, such as Limit By (LimitBy), Group By (GroupBy), and Notification Template (NotificationTemplate).
1. Define the Context#
Populate the applicable context columns in the new row. The labels and order below match the screenshot:
| Column | Purpose |
|---|---|
| STEP | Applies the configuration when loss is recorded at a specific Step. |
| PRODUCT | Applies the configuration to a specific Product. |
| PRODUCT GROUP | Applies the configuration to a Product Group. |
| FLOW | Applies the configuration to a specific Flow and restricts counted losses to that Flow. |
| RESOURCE | Applies the configuration when loss is recorded with a specific Resource. |
| LOSS REASON | Applies the configuration to a specific Loss Reason. |
Use at least one context column. Leaving Product and ProductGroup empty makes the configuration applicable to any Product that matches the remaining context.
A context selects when a row applies. LimitBy selects which recorded losses are accumulated. For example, a row configured for a Step called 'Inspection' and an empty LimitBy can evaluate the accumulated losses across all Steps when a loss is recorded at the 'Inspection' Step. Set LimitBy = Step to count only the losses recorded at the 'Inspection' Step.
Product and Product Group restrictions also filter the Materials contributing to a grouped total. A configured Flow restricts the loss total even when LimitBy is empty.
Note
Flow configuration uses the Flow column. This Smart Table does not provide a separate LogicalFlowPath column.
2. Define the Grouping#
Use GroupBy to define how losses are grouped for accumulation:
| GroupBy | Loss population |
|---|---|
| Empty | The Material on which the loss is recorded. |
ProductionOrder | Materials assigned to the same Production Order that have AccountsToProductionOrderQuantity = true. |
ManufacturerLotNumber | Materials sharing the same Manufacturer Lot Number. |
Grouping is selected through one column. A row cannot group by both Production Order and Manufacturer Lot Number.
The Material must have the grouping value required by the row. A Production Order configuration requires a valid Production Order; a Manufacturer Lot Number configuration requires a non-empty Manufacturer Lot Number. Missing grouping information causes the operation to fail.
The required LimitCheckMode column accepts Individual, ProductionOrder or ManufacturingLotNumber. Populate it to correspond to the intended evaluation mode.
Note
The current evaluator uses GroupBy to determine the loss population and Percentage denominator. LimitCheckMode does not independently change these calculations. Note the different spellings: GroupBy uses ManufacturerLotNumber, while LimitCheckMode uses ManufacturingLotNumber.
3. Define the Limit Scope#
Use LimitBy to restrict accumulation to the context of the current loss:
| LimitBy | Counted losses |
|---|---|
| Empty | All losses in the grouping population, subject to the row's Product, Product Group, and Flow restrictions. |
Step | Losses recorded at the same Step. |
Resource | Losses recorded on the same Resource. |
Reason | Losses recorded for the same Loss Reason. |
Flow | Losses recorded in the same Flow. |
StepResource | Losses recorded at the same Step and Resource. |
StepReason | Losses recorded at the same Step for the same Loss Reason. |
ResourceReason | Losses recorded on the same Resource for the same Loss Reason. |
For example, LimitBy = Reason with an empty LossReason evaluates losses separately for each Reason used. Adding LossReason = Broken makes the row specific to that Reason.
Resource filtering applies when the Material was Dispatched or In Process at loss time and a Resource is available. When Resource context is unavailable, the Resource restriction is not added to the accumulated loss query.
4. Define the Threshold#
Configure the required LimitType and LimitThreshold columns:
| LimitType | Calculation | Example |
|---|---|---|
Absolute | Accumulated loss quantity is compared directly with LimitThreshold. | 10 allows up to 10 units of loss. |
Percentage | (Accumulated loss / Original quantity) × 100 is compared with LimitThreshold. | 10 allows up to 10% loss. |
Percentage values must be at least 0 and less than 100. Enter 10 for 10%, rather than 0.10. A Percentage threshold of 0 means any positive loss violates the limit, provided the original quantity is positive.
The original quantity used in a Percentage calculation depends on GroupBy:
| Grouping | Percentage denominator |
|---|---|
| Individual Material | The Material's MedDevLotOriginalQuantity. |
| Production Order | Sum of MedDevLotOriginalQuantity for Materials in the Production Order that account to its quantity and match the configured Product or Product Group. |
| Manufacturer Lot Number | Sum of MedDevLotOriginalQuantity for Materials sharing the Manufacturer Lot Number and matching the configured Product or Product Group. |
Flow, Step, Resource, and Reason restrictions narrow counted losses; they do not reduce the original-quantity denominator.
Warning
A missing original quantity is treated as zero. If the resulting denominator is zero or negative, Percentage evaluation does not trigger a violation. Verify original quantities before relying on Percentage limits for existing Materials.
5. Define the Actions#
Configure at least one action column:
| Column | Action on first violation |
|---|---|
HoldReason | Places eligible Materials on Hold using the selected Hold Reason. |
Protocol | Opens a Protocol Instance and associates eligible Materials. |
Rule | Executes a custom Rule with the loss Material and context. |
NotificationTemplate | Creates a Notification from the configured template. |
For Hold and Protocol actions, the affected Materials depend on GroupBy:
- Empty: The Material that recorded the loss, provided it has not been terminated.
- Production Order: Active Materials in that Production Order that account to its quantity.
- Manufacturer Lot Number: Active Materials sharing that Manufacturer Lot Number.
Note
Grouped Hold and Protocol actions apply to the eligible grouping population. They are not narrowed by the row's Product, Product Group, Flow, Step, Resource, or Reason restrictions. A Product-specific threshold can therefore trigger Hold or Protocol actions for other Products in the same group.
The custom Rule receives Material, Step, Resource, and Reason as inputs to use in its logic. Resource is available only for Dispatched or In Process Materials; otherwise, its value is null. Reason is supplied only for Reason, StepReason, or ResourceReason limits. The Rule defines any additional actions it performs.
Notification Templates#
NotificationTemplate must reference an active Notification with IsTemplate = true. Configure the intended recipients in that template.
The following tokens can be used in the template's Title and Details:
| Token | Value |
|---|---|
{{Step}} | Step where the loss was recorded. |
{{Resource}} | Resource where the loss was recorded, when available. |
{{Reason}} | Loss Reason that triggered the violation. |
{{Materials}} | The loss Material, followed by other eligible Materials in the grouping population matching the Product or Product Group restrictions; Production Order members must account to its quantity. |
{{ProductionOrder}} | Production Order name, when available. |
{{ManufacturerLotNumber}} | Manufacturer Lot Number, when available. |
For example:
Title: Scrap limit violation at {{Step}}
Details: Review {{Materials}} following loss recorded for {{Reason}}.
With Step 'Cleaning Station', Materials 'Material X1' and 'Material X2', and Reason 'Broken Tip', the resulting notification is:
Title: Scrap limit violation at Cleaning Station
Details: Review Material X1, Material X2 following loss recorded for Broken Tip.
Configuration Validation#
When saving or uploading Smart Table rows, the system validates that:
- At least one action between
HoldReason,Protocol,NotificationTemplate, orRuleis configured. - Percentage thresholds are within the supported range.
- If
LossReasonis supplied,LimitByisReason,StepReason, orResourceReason. LossReasonis of type Loss and belongs to the selected Step's Loss Reasons when a Step is supplied.HoldReasonis of type Hold and belongs to the selected Step's Hold Reasons when a Step is supplied. For Hold configurations, select a Step and associate the Hold Reason with it.NotificationTemplateexists, is active, and is marked as a template.
Execution Behavior#
Every Record Loss operation, including losses recorded during Track-Out, follows this sequence while the feature is enabled:
- Record the loss context. The loss is logged with its Material, Production Order, Manufacturer Lot Number, Flow, Step, Resource, Reason, quantity, and timestamp. The context reflects where the loss occurred, including when Continuous Flow handling subsequently moves the Material.
- Resolve applicable configurations. The Smart Table is resolved separately for rows with a specific Loss Reason and rows without one.
- Accumulate losses. The current loss is included in the total selected by the row's grouping and limit scope.
- Compare with the threshold. A total at or below the limit does not trigger actions.
- Respond to a violation. When the total first crosses the limit, configured actions execute. If the total was already above the limit before the current Record Loss, the system returns a warning without executing those actions again. Losses recorded together, such as several loss reasons in one Record Loss, count as a single submission.
Warnings are returned as feedback on Record Loss or Track-Out responses. The current implementation does not provide a warning asking the operator to confirm a first violation before recording the loss.
During Track-Out, Hold actions are applied after Track-Out and any associated Continuous Flow movement finished/finishes. This allows movement associated with the operation to complete before the affected Materials are held.
Context Precedence#
The Smart Table uses ordered precedence keys, from detailed contexts such as Step + Product + Flow + Resource + LossReason to single-context keys.
Within each resolution pass, only the first resolved row for a given LimitBy / GroupBy combination is evaluated. A later row with the same combination is skipped. Rows with different combinations can be evaluated independently.
Reason-specific and generic configurations are evaluated in separate passes. Both can apply to the same loss, allowing a specific Reason limit and a broader scrap limit to trigger their respective actions.
For Smart Table columns and precedence details, see the Tables reference.
Example Scenarios#
In these examples, each row includes at least one configured action and the required LimitCheckMode.
| Context | GroupBy | LimitBy | Type and threshold | Violation condition |
|---|---|---|---|---|
| Product A | Empty | Empty | Absolute 10 | One Material of Product A accumulates more than 10 units of loss. |
| Product A | ProductionOrder | Empty | Absolute 10 | Counted Materials of Product A in the same Production Order accumulate more than 10 units of loss. |
| Product A, Flow F1 | Empty | Step | Absolute 10 | One Material of Product A accumulates more than 10 units of loss at the same Step in Flow F1. |
| Flow F1, Step X | ProductionOrder | Step | Percentage 10 | Accumulated loss at Step X in Flow F1 exceeds 10% of the summed original quantities of counted Production Order Materials. |
| Flow F1 | ManufacturerLotNumber | Empty | Absolute 10 | Materials sharing a Manufacturer Lot Number accumulate more than 10 units of loss in Flow F1. |
| Product A, Loss Reason Broken | Empty | Reason | Absolute 10 | One Material of Product A accumulates more than 10 units of loss for Broken. |
Individual Material: First and Repeat Violations#
Configure a row with the following values:
| Column | Value |
|---|---|
Product | Product A |
GroupBy | Empty |
LimitCheckMode | Individual |
LimitBy | Empty |
LimitType | Absolute |
LimitThreshold | 10 |
NotificationTemplate | An active scrap violation Notification template |
For one Material of Product A:
- Record a loss of 6 units. The accumulated total is 6; no action is triggered.
- Record a loss of 4 units. The accumulated total is 10; no action is triggered because equality is allowed.
- Record a loss of 1 unit. The accumulated total is 11; a Notification is created.
- Record another loss of 1 unit. The accumulated total is 12; a repeat-violation warning is returned and another Notification is not created for this threshold crossing.
Production Order: Percentage Limit#
Two Materials belonging to the same Production Order have original quantities of 60 and 40. Both account to the Production Order quantity and match the configured Product context.
Configure a row with the following values:
| Column | Value |
|---|---|
Product | Product A |
GroupBy | ProductionOrder |
LimitCheckMode | ProductionOrder |
LimitBy | Empty |
LimitType | Percentage |
LimitThreshold | 10 |
NotificationTemplate | An active scrap violation Notification template |
The denominator is 100:
- A counted loss total of 10 units equals 10% and is accepted.
- A counted loss total of 11 units equals 11% and triggers the configured actions.
If the row specifies LimitBy = Step, only losses at the current Step count toward that total. The denominator remains 100.
Administration#
Original Quantity#
The MedDevLotOriginalQuantity Material attribute is maintained while the feature is enabled:
- Create: Set to the created Material's primary quantity.
- Clone: Set to the cloned Material's own primary quantity, replacing any inherited original quantity.
- Merge: Add the merged child Materials' original quantities to the target Material's original quantity. If the target attribute is absent, its current primary quantity is used as the starting value. A missing child attribute contributes zero.
- Split: Move each child Material's split quantity from the source Material's original quantity to the child, so the summed original quantity of the source and its children is unchanged (for example, splitting 5 from a Material with original quantity 10 leaves 5 on each). A child never receives more than the source has left; if the source is left without quantity, its whole remaining original quantity goes to the last child. If the source has no original quantity, nothing is changed.
Enabling the feature does not automatically initialize this attribute on existing Materials.
Loss Logs and Retention#
The MedDevScrapLimitRecordLossLogs Generic Table is the source of accumulated scrap totals. Losses recorded before the feature was enabled are not automatically added to this table.
The current log stores loss quantities as integers; fractional quantities are truncated when logged. Account for this behavior before using the feature for Materials measured in fractional units.
| Configuration entry | Default | Purpose |
|---|---|---|
/MedDev/ScrapLimitViolation/PurgeRecordLossLogsInDays | 365 | Retention period used when purging loss logs. |
/MedDev/ScrapLimitViolation/PurgeRecordLossBatchSize | 1000 | Maximum number of expired logs removed in one purge batch. |
The MedDevClearRecordLossLogEntries action removes expired entries in batches. Purged losses no longer contribute to threshold calculations. Choose retention settings that preserve losses needed for the expected lifetime of a Material or group.
Repeat-violation handling compares the accumulated total before and after the current Record Loss, including all of its loss reasons. It does not keep a separate permanent record that an action has already executed. Changes to retained logs, thresholds, or the Percentage denominator can affect whether a later loss is treated as a new threshold crossing.
For technical configuration details, see Configuration Entries, Tables, and DEEs.
