Overview
Some processes have multiple types of material inputs and outputs. Depending on the information provided by operators and/or SCADA, some material resources are optional. The following script example demonstrates how to determine, after the fact through scripting, which material resources were utilized in a Response Segment.
Applies To and Version Info
This feature applies to Track and Trace and is available in 3.8x versions and later.
Details
The Response Segment's complex properties are handled in the script function below, with line-by-line comments for clarity.
Scripting
In the following script example, a Response Segment is loaded, then the Response Material Complex Properties are retrieved. For each Response Material Complex Property, the lot UUID is printed. Note that an optional material resource that was not utilized would have a null UUID.
Code |
|
Note here in the result panel that the script produces the Material Resource name (Complex Property Name) as defined in the segment, as well as the lot UUID for the lot used, the type of material, and the quantity of the Material Lot.
Both material resources are configured as optional, and "Material Out 2" is not used in this example segment. Note that it has a null (i.e. None) UUID or quantity.
Result
Code |
Material Out be204bd5-8a91-4ab6-b84f-44a01e894994 TestMat1 10.0 Material Out 2 None TestMat1 None |
References
Response Segment
Material Lot
AbstractMESObject
system.mes.loadMESObject
Keywords
Track and Trace, Complex Property, Complex Properties, Response Material, Material Resources, Material References, Optional Materials, Response Segment Information