Customization > Validation Guidelines for Automation of Customizations > Customization and Automation Samples for Java Classes used in Workflow/OIR/Business Rule/Listeners
Customization and Automation Samples for Java Classes used in Workflow/OIR/Business Rule/Listeners
PTC has provided examples of customizations involving Java code samples and unit test samples of OIR, workflow, and listeners. All configuration steps are mentioned in the <WT_HOME>\prog_examples\customization\ReadMe.txt file.
OIR
OIR may use external classes, such as customizations of algorithms or sequences.
Example use case: Creation of a part having a prefix in its number using a custom algorithm for OIR.
Source: AppendStringAlgorithm.java file provided in prog_example.
Algorithm: Create a part with prefix text “TestAlgorithm Test” in the part number.
Artifacts:
RuleAlgorithm java file — Custom code (AppendStringAlgorithm.java)
Container template — Configuration in the form of a loader.
Rule.xml configured within container — Configuration in the form of a loader.
Verification:
Unit-level test of code that is within given input parameters and verified output values.
Actual scenario verification, which is to create a part within a container and verify the prefix text.
* 
Above examples files are provided with Windchill in the <WT_HOME>\prog_examples\customization\CustomModule\main\src\com\acme\OIR\AppendStringAlgorithm.java directory.
Configured rule AppendStringAlgorithm.xml file as OIR for CustomTestProduct02 product.
The example unit test written for this OIR algorithm can be found at <WT_HOME>\prog_examples\customization\CustomModule\test\unit\src\com\acme\OIR\AppendStringAlgorithmTest.java directory.
Workflow
The source sample for workflow is located in the <WT_HOME>\prog_examples\customization\CustomModule\main\src\com\acme\helper\WorkflowHelper.java directory.
The example unit test written for this workflow algorithm is located in the <WT_HOME>\prog_examples\customization\CustomModule\test\unit\src\com\acme\workflow\WorkflowHelperTest.java directory.
Listeners
The source sample for custom listeners is located in the below directory:
<WT_HOME>\prog_examples\customization\CustomModule\main\src\com\acme\customListeners\WTPartCustomEventListeners1.java
<WT_HOME>\prog_examples\customization\CustomModule\main\src\com\acme\customListeners\WTPartCustomEventListeners2.java
The example unit test written for custom listeners is located in the <WT_HOME>\prog_examples\customization\CustomModule\test\unit\src\com\acme\customListeners\WTPartCustomEventListenersTest.java directory.
Was this helpful?