Customizing Part Allocation Sequence Numbers
Objective
Customize the default logic to start the part allocation sequence from a custom number or display the sequence based on specific organizational requirements.
Solution
Use the out‑of‑the‑box delegate framework to auto-populate the allocation sequence numbers during part allocation, while allowing customers to plug in custom logic.
Prerequisite Knowledge
To perform this task, you must have an understanding of the following:
• Java fundamentals (inheritance, collections)
• Windchill delegates and xconfmanager utility
• MPMLink objects: MPMOperation, MPMOperationToPartLink, AssociativeUsageLink
Solution Elements
• NextAllocationSequenceNumberDelegate
Interface that Windchill invokes when new MPMOperationToPartLink objects are created.
• DefaultNextAllocationSequenceNumberDelegate
OOTB implementation that increments the allocation sequence number by one.
• CustomNextAllocationSequenceNumberDelegate
Custom implementation tailored to project-specific allocation rules.
Procedure
To implement custom logic for part allocation sequence, follow these steps:
1. Create a new delegate class, such as CustomNextAllocationSequenceNumberDelegate, by extending DefaultNextAllocationSequenceNumberDelegate.
2. Register the delegate in the mpmlink.service.properties.xconf file.
3. Override the populateAllocationData() method and optionally getIncrementStep().
4. Run xconfmanager -p and restart method servers.
OOTB Implementation
The OOTB implementation for part allocation sequence is shown here:
Sample XCONF Snippet
The following is a sample XCONF configuration that registers your custom delegate:
<Service context="default"
name="com.ptc.windchill.mpml.processplan.operation.NextAllocationSequenceNumberDelegate">
<Option cardinality="singleton"
requestor="com.ptc.windchill.mpml.processplan.operation.MPMOperationHolder"
selector="DEFAULT"
serviceClass="com.ptc.windchill.mpml.processplan.operation.CustomNextAllocationSequenceNumberDelegate"/>
</Service>
Sample Implementation
The following example shows a custom implementation of the allocation sequence delegate that increments the part allocation sequence number by two.
package com.ptc.windchill.mpml.processplan.operation;
public class CustomNextAllocationSequenceNumberDelegate extends DefaultNextAllocationSequenceNumberDelegate {
@Override
protected long getIncrementStep() {
//Override the default increment of 1 with a step increment of 2.
return 2L;
}
}