Sepasoft MES Module Suite
AbstractMESObjectFunctions
All objects that inherit from the AbstractMESObject inherit these functions.
Artifact Names
|
Artifact names are always set to lowercase to be case insensitive, when you call any of the artifact methods for get/set/create artifact the name is lowercased first. |
- Artifact Object Functions
- createArtifact(artifactName, serializableValue)
- createArtifact(artifactName, serializableValue, versioned)
- getArtifactCount()
- getAllArtifactNames()
- getArtifactNames()
- getArtifactProperty(artifactName)
- getArtifactProperties()
- getArtifactValueByName(artifactName)
- getArtifactValueByUUID(artifactUUID)
- setArtifactValue(artifactName, serializableValue)
- Object Functions
- addChild(mesObject)
- addChild(mesObjectLink)
- addCustomProperty(name, dataTypeName, description, units, productionVisible, required, value)
- addCustomProperty(name, dataTypeName, description, units, productionVisible, required)
- addCustomProperty(name, dataTypeName)
- addCustomProperty(property, overrideInherited)
- addCustomProperty(parentPath, name, dataTypeName, description, units, productionVisible, required, value)
- addCustomProperty(parentPath, name, dataTypeName, description, units, productionVisible, required)
- addCustomProperty(parentPath, name, dataTypeName)
- addParent(mesObject)
- addParent(mesObjectLink)
- createComplexProperty(complexPropertyType, name)
- getAllCustomProperties()
- getChildCollection()
- getComplexProperty(complexPropertyName, entryName)
- getComplexProperty(complexPropertyName, index)
- getComplexProperty(path)
- getComplexPropertyByKind(path)
- getComplexPropertyCount(complexPropertyName)
- getComplexPropertyItemNames(complexPropertyName)
- getComplexPropertyTypeNames()
- getCoreProperties()
- getCustomProperties()
- getCustomPropertiesFull()
- getCustomPropertiesFull(complexPropertyName, entryName)
- getCustomPropertyDescription(propertyPath)
- getCustomPropertyEnabled(propertyPath)
- getCustomPropertyUnits(propertyPath)
- getCustomPropertyValues(complexPropertyType, name)
- getInheritedProperties()
- getMESObjectType()
- getMESObjectTypeName()
- getName()
- getParentCollection()
- getPropertyValue(propertyPath)
- getUUID()
- getVersion()
- isEnabled()
- isModified()
- removeChild(mesObject)
- removeComplexProperty(complexPropertyName, entryName)
- removeCustomProperty(propertyPath)
- removeParent(mesObject)
- renameComplexProperty(complexPropertyName, entryName, newEntryName)
- renameCustomProperty(propertyPath, newName)
- setCustomPropertyDescription(propertyPath, description)
- setCustomPropertyEnabled(propertyPath, enable)
- setCustomPropertyUnits(propertyPath, units)
- setCustomPropertyValues(customProperties)
- setEnabled(enable)
- setPropertyValue(propertyPath, value)
Artifact Object Functions
MES objects inherit these functions. Use these functions to add artifacts to objects.
Artifact Names
|
Artifact names are always set to lowercase to be case insensitive, when you call any of the artifact methods for get/set/create artifact the name is lowercased first. |
createArtifact(artifactName, serializableValue)
Create a new MES Artifact property named by artifactName on an existing MES Object, with a provided primitive, Pythonic or Java serializable object as the serializableValue (including strings, integer/real/float/double numbers and Boolean). The new MES Artifact is 'versioned' so each save creates a new version of the artifact (one additional row in the DB per version saved).
Files are also 'serializable' (Artifacts serialize the file as an array of bytes. Add "from java.io import File" to script and use File (fileName) where fileName contains the path to the file, with filename and extension. Refer to the Java Class File page).
createArtifact(artifactName, serializableValue)
- Parameters
String artifactName - the name of the 'versioned' MES Artifact to create. Name will be stored using lower-case letters.
Serializable serializableValue - Any primitive, Pythonic or Java serializable object (including strings, integer/real/float/double numbers and Boolean). Files are also 'serializable'.
- Returns
MESArtifactProperty - A reference to the newly-created Artifact property.
- Scope
All
Python |
# Create a new 'versioned' MES Artifact object called 'my artifact' # on the Material Definition 'Test Material' and set the value # of the new Artifact to the string "Hello World". obj = system.mes.loadMESObject('Test Material', 'MaterialDef') obj.createArtifact('my artifact', 'Hello World') system.mes.saveMESObject(obj) |
createArtifact(artifactName, serializableValue, versioned)
Create a new MES Artifact property named by artifactName on an existing MES Object, with a provided primitive, Pythonic or Java serializable object as the serializableValue (including strings, integer/real/float/double numbers and Boolean).
Files are also 'serializable' (Artifacts serialize the file as an array of bytes. Add "from java.io import File" to script and use File (fileName) where fileName contains the path to the file, with filename and extension. Refer to the Java Class File page).
If versioned=FALSE, only one artifact with the version 0 is created and each save overwrites the previous value. If versioned=TRUE, then the artifact is saved with its timestamp, such that each save creates a new version of the artifact (one additional row in the DB per version saved).
createArtifact(artifactName, serializableValue, versioned)
- Parameters
String artifactName - the name of the Artifact to create. Name will be stored using lower-case letters.
Serializable serializableValue - Any primitive, Pythonic or Java serializable object (including strings, integer/real/float/double numbers and Boolean. Files are also 'serializable'.
Boolean versioned - FALSE means only one artifact is stored and is overwritten on each save. TRUE keeps a versioned copy with timestamp as an additional row in the database on each save.
- Returns
MESArtifactProperty - A reference to the newly-created Artifact property.
- Scope
All
Python |
# Create a new 'unversioned' MES Artifact object called 'unversioned artifact' # on the Material Definition 'Test Material' and set the value # of the new Artifact to the string "Hello World". obj = system.mes.loadMESObject('Test Material', 'MaterialDef') obj.createArtifact('unversioned artifact', 'Hello World', False) system.mes.saveMESObject(obj) |
getArtifactCount()
Returns the number of artifacts that exist for this MES Object.
getArtifactCount()
- Parameters
None
- Returns
Integer - The number of artifacts that exist for this MES Object.
- Scope
All
getAllArtifactNames()
Returns a list with the Name property for all artifacts that exist for this MES Object, as well as for all parent objects.
getAllArtifactNames()
- Parameters
None
- Returns
List - A Pythonic list with the Name property for all artifacts that exist for this MES Object, as well as for all parent objects. Names have all been previously created with lower-case letters.
- Scope
All
getArtifactNames()
Returns a list with the Name property for all artifacts that exist for this MES Object.
getArtifactNames()
- Parameters
None
- Returns
List - A Pythonic list with the Name property for all artifacts that exist for this MES Object. Names have all been previously created with lower-case letters.
- Scope
All
getArtifactProperty(artifactName)
Returns the MES Artifact Property of the specified Artifact on the MES Object.
getArtifactProperty(artifactName)
- Parameters
String artifactName - The Name of the Artifact on the MES Object. Names have all been previously created with lower-case letters.
- Returns
MESArtifactProperty - The MES Artifact Property of the specified Artifact on the MES Object.
- Scope
All
getArtifactProperties()
Returns all of the MES Artifact Properties of the specified Artifact on the MES Object.
getArtifactProperties()
- Parameters
None
- Returns
MESPropertyCollection - All of the MES Artifact Properties of the specified Artifact on the MES Object.
- Scope
All
getArtifactValueByName(artifactName)
Returns the value of the Artifact on the MES Object specified by the Artifact's Name.
getArtifactValueByName(artifactName)
- Parameters
String artifactName - The Name of the Artifact on the MES Object. Names have all been previously created with lower-case letters.
- Returns
Serializable - The primitive, Pythonic or Java serializable object value stored for the Artifact on the MES Object. Files are also 'serializable', so file contents are returned as an array of bytes.
- Scope
All
Python |
obj = system.mes.loadMESObject('Widget A', 'MaterialDef') ds = obj.getArtifactValueByName('test data') print ds ##prints data set. |
getArtifactValueByUUID(artifactUUID)
Returns the value of the Artifact on the MES Object specified by the Artifact's UUID.
getArtifactValueByUUID(artifactName)
- Parameters
String artifactUUID - The UUID of the Artifact on the MES Object.
- Returns
Serializable - The primitive, Pythonic or Java serializable object value stored for the Artifact on the MES Object. Files are also 'serializable', so file contents are returned as an array of bytes.
- Scope
All
setArtifactValue(artifactName, serializableValue)
Updates an existing MES Artifact property named by artifactName on an existing MES Object, with a provided primitive, Pythonic or Java serializable object as the serializableValue (including strings, integer/real/float/double numbers and Boolean).
Files are also 'serializable' (Artifacts serialize the file as an array of bytes. Add "from java.io import File" to script and use File (fileName) where fileName contains the path to the file, with filename and extension. Refer to the Java Class File page).
setArtifactValue(artifactName, serializableValue)
- Parameters
String artifactName - the name of the Artifact to update. Names have all been previously created with lower-case letters.
Serializable serializableValue - Any primitive, Pythonic or Java serializable object (including strings, integer/real/float/double numbers and Boolean). Files are also 'serializable'.
- Returns
Nothing
- Scope
All
Object Functions
addChild(mesObject)
Add a MES object as a child to another MES object. MES objects can have children and parents. Depending on the type of MES object determines the types of children or parents that can be added. For example, a material class (MESMaterialClass) object can have material definitions (MESMaterialDef) as children, but material definitions objects cannot have material class objects as children.
Note
When a child is added to an MES object, then a parent reference will be added to the child behind the scenes. Likewise, when a parent is added to a child, a child reference will be added to the parent behind the scenes. This insures if integrity of relationships are maintained.
addChild(mesObject)
- Parameters
AbstractMESObject mesObject - An instance to an MES object. An AbstractMESObject object is just the generic form of an MES object when the specific type is unknown.
- Returns
Nothing
- Scope
All
Python |
#Get the Screws material class object matCls = system.mes.loadMESObject('Screws', 'MaterialClass') #Get the 10-32 NC Screw material definition object matDef = system.mes.loadMESObject('10-32 NC Screw', 'MaterialDef') #Add the 10-32 NC Screw material definition object as a child to the Screws material class object matCls.addChild(matDef) #Save the changes system.mes.saveMESObject(matCls) |
addChild(mesObjectLink)
Add a MES object link as a child to another MES object. MES objects can have children and parents. Depending on the type of MES object determines the types of children or parents that can be added. For example, a material class (MESMaterialClass) object can have material definitions (MESMaterialDef) as children, but material definitions objects cannot have material class objects as children.
Note
When a child is added to an MES object, then a parent reference will be added to the child behind the scenes. Likewise, when a parent is added to a child, a child reference will be added to the parent behind the scenes. This insures if integrity of relationships are maintained.
addChild(mesObject)
- Parameters
MES Object Link mesObjectLink - A link to an MES object. A MES Object Link holds identification information to a MES object. This is very efficient when displaying MES objects in a list and all the MES object details are not needed.
- Returns
Nothing
- Scope
All
Python |
#Get the Screws material class object matCls = system.mes.loadMESObject('Screws', 'MaterialClass') #Get the 10-32 NC Screw material definition object matDef = system.mes.loadMESObject('10-32 NC Screw', 'MaterialDef') #Add the 10-32 NC Screw material definition object as a child to the Screws material class object matCls.addChild(matDef) #Save the changes system.mes.saveMESObject(matCls) |
addCustomProperty(name, dataTypeName, description, units, productionVisible, required, value)
Custom properties can be added to MES objects or even complex properties (such as a material, equipment or personnel reference) of an MES object. The AbstractMESObject Functions method can be used to add a custom property directly to a MES object by not specifying a path to the parent property. To add a custom property as a child of an existing custom property or to a complex property, the parent path is used to specify the parent.
Each level of the path is separated with a period. This allows for names to be duplicated provided the path is unique. For example, it is possible for a MES object to have custom properties "Dimension 1.Width" and "Dimension 2.Width"
addCustomProperty(name, dataTypeName, description, units, productionVisible, required, value)
- Parameters
String name - Name of the custom property to add.
String dataTypeName - Name of the Ignition data type to make the new custom property. Options: Int1, Int2, Int4, Int8, Float4, Float8, Boolean, String, DateTime, Text, Int1Array, Int2Array, Int4Array, Int8Array, Float4Array, Float8Array, BooleanArray, StringArray, DateTimeArray.
String description - The description of the custom property.
String units - The units of the new custom property. This is just for reference.
boolean productionVisible - The default is false. If True, show the custom property in various components. If False, it will be hidden and can be used to store values behind the scenes.
boolean required - If True, a value must be assigned to the custom property before and segment is ended.
String value - The value to assign to the custom property after it has been added. Note that this value is cast to a string, even if the custom property is not a string.
- Returns
Nothing
- Scope
All
Python |
#Load a MES object obj = system.mes.loadMESObject('Box', 'MaterialDef') #Add Type custom property directly to the MES object obj.addCustomProperty('Type', 'String') #Add Dimension custom property directly to the MES object obj.addCustomProperty('Dimension', 'String', 'Dimension of box', '', True, False) #Add Width custom property to the previous Dimension custom property and assign a value obj.addCustomProperty('Dimension', 'Width', 'Int4', 'Width of box', 'in', True, False, '24') #Add Height custom property to the previous Dimension custom property and assign a value obj.addCustomProperty('Dimension', 'Height', 'Int4', 'Height of box', 'in', True, False, '12') #Type custom property was never assigned a value so None is returned print obj.getPropertyValue('Type') #Remember to save the MES object system.mes.saveMESObject(obj) #Width and Height custom properties were assigned values print obj.getPropertyValue('Dimension.Width') print obj.getPropertyValue('Dimension.Height') |
addCustomProperty(name, dataTypeName, description, units, productionVisible, required)
Custom properties can be added to MES objects or even complex properties (such as a material, equipment or personnel reference) of an MES object. The AbstractMESObject Functions method can be used to add a custom property directly to a MES object by not specifying a path to the parent property. To add a custom property as a child of an existing custom property or to a complex property, the parent path is used to specify the parent.
Each level of the path is separated with a period. This allows for names to be duplicated provided the path is unique. For example, it is possible for a MES object to have custom properties "Dimension 1.Width" and "Dimension 2.Width"
addCustomProperty(name, dataTypeName, description, units, productionVisible, required)
- Parameters
String name - The name of the custom property to add.
String dataTypeName - Name of the Ignition data type to make the new custom property. Options: Int1, Int2, Int4, Int8, Float4, Float8, Boolean, String, DateTime, Text, Int1Array, Int2Array, Int4Array, Int8Array, Float4Array, Float8Array, BooleanArray, StringArray, DateTimeArray.
String description - The description of the custom property.
String units - The units of the new custom property. This is just for reference.
boolean productionVisible - The default is false. If True, show the custom property in various components. If False, it will be hidden and can be used to store values behind the scenes.
boolean required - If True, a value must be assigned to the custom property before and segment is ended.
- Returns
Nothing
- Scope
All
Python |
#Load a MES object obj = system.mes.loadMESObject('Box', 'MaterialDef') #Add Type custom property directly to the MES object obj.addCustomProperty('Type', 'String') #Add Dimension custom property directly to the MES object obj.addCustomProperty('Dimension', 'String', 'Dimension of box', '', True, False) #Add Width custom property to the previous Dimension custom property and assign a value obj.addCustomProperty('Dimension', 'Width', 'Int4', 'Width of box', 'in', True, False, '24') #Add Height custom property to the previous Dimension custom property and assign a value obj.addCustomProperty('Dimension', 'Height', 'Int4', 'Height of box', 'in', True, False, '12') #Type custom property was never assigned a value so None is returned print obj.getPropertyValue('Type') #Remember to save the MES object system.mes.saveMESObject(obj) #Width and Height custom properties were assigned values print obj.getPropertyValue('Dimension.Width') print obj.getPropertyValue('Dimension.Height') |
addCustomProperty(name, dataTypeName)
Custom properties can be added to MES objects or even complex properties (such as a material, equipment or personnel reference) of an MES object. The AbstractMESObject Functions method can be used to add a custom property directly to a MES object by not specifying a path to the parent property. To add a custom property as a child of an existing custom property or to a complex property, the parent path is used to specify the parent.
Each level of the path is separated with a period. This allows for names to be duplicated provided the path is unique. For example, it is possible for a MES object to have custom properties "Dimension 1.Width" and "Dimension 2.Width"
addCustomProperty(name, dataTypeName)
- Parameters
String name - The name of the custom property to add.
String dataTypeName - Name of the Ignition data type to make the new custom property. Options: Int1, Int2, Int4, Int8, Float4, Float8, Boolean, String, DateTime, Text, Int1Array, Int2Array, Int4Array, Int8Array, Float4Array, Float8Array, BooleanArray, StringArray, DateTimeArray.
- Returns
Nothing
- Scope
All
Python |
#Load a MES object obj = system.mes.loadMESObject('Box', 'MaterialDef') #Add Type custom property directly to the MES object obj.addCustomProperty('Type', 'String') #Add Dimension custom property directly to the MES object obj.addCustomProperty('Dimension', 'String', 'Dimension of box', '', True, False) #Add Width custom property to the previous Dimension custom property and assign a value obj.addCustomProperty('Dimension', 'Width', 'Int4', 'Width of box', 'in', True, False, '24') #Add Height custom property to the previous Dimension custom property and assign a value obj.addCustomProperty('Dimension', 'Height', 'Int4', 'Height of box', 'in', True, False, '12') #Type custom property was never assigned a value so None is returned print obj.getPropertyValue('Type') #Remember to save the MES object system.mes.saveMESObject(obj) #Width and Height custom properties were assigned values print obj.getPropertyValue('Dimension.Width') print obj.getPropertyValue('Dimension.Height') |
None 24 12
addCustomProperty(property, overrideInherited)
Adds a custom property to the object, with options for handling inherited property conflicts.
addCustomProperty(property, overrideInherited)
- Parameters
- MESCustomProperty property - An instance of a MESCustomProperty from another object or an inherited property
- boolean overrideInherited - Controls behavior when a property name conflicts with an inherited property:
- true: Creates a new property with the same name that overrides the inherited property
- false: Renames the property by appending "- #" to prevent conflicts with inherited properties
- Returns
Nothing
- Scope
All
Refer to Overriding Inherited Custom Properties for a code example.
addCustomProperty(parentPath, name, dataTypeName, description, units, productionVisible, required, value)
Custom properties can be added to MES objects or even complex properties (such as a material, equipment or personnel reference) of an MES object. The AbstractMESObject Functions method can be used to add a custom property directly to a MES object by not specifying a path to the parent property. To add a custom property as a child of an existing custom property or to a complex property, the parent path is used to specify the parent.
Each level of the path is separated with a period. This allows for names to be duplicated provided the path is unique. For example, it is possible for a MES object to have custom properties "Dimension 1.Width" and "Dimension 2.Width"
addCustomProperty(parentPath, name, dataTypeName, description, units, productionVisible, required, value)
- Parameters
String parentPath - The path of the parent to add the custom property to.
String name - The name of the custom property to add.
String dataTypeName - Name of the Ignition data type to make the new custom property. Options: Int1, Int2, Int4, Int8, Float4, Float8, Boolean, String, DateTime, Text, Int1Array, Int2Array, Int4Array, Int8Array, Float4Array, Float8Array, BooleanArray, StringArray, DateTimeArray.
String description - The description of the custom property.
String units - The units of the new custom property. This is just for reference.
boolean productionVisible - The default is false. If True, show the custom property in various components. If False, it will be hidden and can be used to store values behind the scenes.
boolean required - If True, a value must be assigned to the custom property before and segment is ended.
String value - The value to assign to the custom property after it has been added. Note that this value is cast to a string, even if the custom property is not a string.
- Returns
Nothing
- Scope
All
Python |
#Load a MES object obj = system.mes.loadMESObject('Box', 'MaterialDef') #Add Type custom property directly to the MES object obj.addCustomProperty('Type', 'String') #Add Dimension custom property directly to the MES object obj.addCustomProperty('Dimension', 'String', 'Dimension of box', '', True, False) #Add Width custom property to the previous Dimension custom property and assign a value obj.addCustomProperty('Dimension', 'Width', 'Int4', 'Width of box', 'in', True, False, '24') #Add Height custom property to the previous Dimension custom property and assign a value obj.addCustomProperty('Dimension', 'Height', 'Int4', 'Height of box', 'in', True, False, '12') #Type custom property was never assigned a value so None is returned print obj.getPropertyValue('Type') #Remember to save the MES object system.mes.saveMESObject(obj) #Width and Height custom properties were assigned values print obj.getPropertyValue('Dimension.Width') print obj.getPropertyValue('Dimension.Height') |
None 24 12
addCustomProperty(parentPath, name, dataTypeName, description, units, productionVisible, required)
Custom properties can be added to MES objects or even complex properties (such as a material, equipment or personnel reference) of an MES object. The AbstractMESObject Functions method can be used to add a custom property directly to a MES object by not specifying a path to the parent property. To add a custom property as a child of an existing custom property or to a complex property, the parent path is used to specify the parent.
Each level of the path is separated with a period. This allows for names to be duplicated provided the path is unique. For example, it is possible for a MES object to have custom properties "Dimension 1.Width" and "Dimension 2.Width"
addCustomProperty(parentPath, name, dataTypeName, description, units, productionVisible, required)
- Parameters
String parentPath - The path of the parent to add the custom property to.
String name - The name of the custom property to add.
String dataTypeName - Name of the Ignition data type to make the new custom property. Options: Int1, Int2, Int4, Int8, Float4, Float8, Boolean, String, DateTime, Text, Int1Array, Int2Array, Int4Array, Int8Array, Float4Array, Float8Array, BooleanArray, StringArray, DateTimeArray.
String description - The description of the custom property.
String units - The units of the new custom property. This is just for reference.
boolean productionVisible - The default is false. If True, show the custom property in various components. If False, it will be hidden and can be used to store values behind the scenes.
boolean required - If True, a value must be assigned to the custom property before and segment is ended.
- Returns
Nothing
- Scope
All
Python |
#Load a MES object obj = system.mes.loadMESObject('Box', 'MaterialDef') #Add Type custom property directly to the MES object obj.addCustomProperty('Type', 'String') #Add Dimension custom property directly to the MES object obj.addCustomProperty('Dimension', 'String', 'Dimension of box', '', True, False) #Add Width custom property to the previous Dimension custom property and assign a value obj.addCustomProperty('Dimension', 'Width', 'Int4', 'Width of box', 'in', True, False, '24') #Add Height custom property to the previous Dimension custom property and assign a value obj.addCustomProperty('Dimension', 'Height', 'Int4', 'Height of box', 'in', True, False, '12') #Type custom property was never assigned a value so None is returned print obj.getPropertyValue('Type') #Remember to save the MES object system.mes.saveMESObject(obj) #Width and Height custom properties were assigned values print obj.getPropertyValue('Dimension.Width') print obj.getPropertyValue('Dimension.Height') |
None 24 12
addCustomProperty(parentPath, name, dataTypeName)
Custom properties can be added to MES objects or even complex properties (such as a material, equipment or personnel reference) of an MES object. The AbstractMESObject Functions method can be used to add a custom property directly to a MES object by not specifying a path to the parent property. To add a custom property as a child of an existing custom property or to a complex property, the parent path is used to specify the parent.
Each level of the path is separated with a period. This allows for names to be duplicated provided the path is unique. For example, it is possible for a MES object to have custom properties "Dimension 1.Width" and "Dimension 2.Width"
addCustomProperty(parentPath, name, dataTypeName)
- Parameters
String parentPath - The path of the parent to add the custom property to.
String name - The name of the custom property to add.
String dataTypeName - Name of the Ignition data type to make the new custom property. Options: Int1, Int2, Int4, Int8, Float4, Float8, Boolean, String, DateTime, Text, Int1Array, Int2Array, Int4Array, Int8Array, Float4Array, Float8Array, BooleanArray, StringArray, DateTimeArray.
- Returns
Nothing
- Scope
All
Python |
#Load a MES object obj = system.mes.loadMESObject('Box', 'MaterialDef') #Add Type custom property directly to the MES object obj.addCustomProperty('Type', 'String') #Add Dimension custom property directly to the MES object obj.addCustomProperty('Dimension', 'String', 'Dimension of box', '', True, False) #Add Width custom property to the previous Dimension custom property and assign a value obj.addCustomProperty('Dimension', 'Width', 'Int4', 'Width of box', 'in', True, False, '24') #Add Height custom property to the previous Dimension custom property and assign a value obj.addCustomProperty('Dimension', 'Height', 'Int4', 'Height of box', 'in', True, False, '12') #Type custom property was never assigned a value so None is returned print obj.getPropertyValue('Type') #Remember to save the MES object system.mes.saveMESObject(obj) #Width and Height custom properties were assigned values print obj.getPropertyValue('Dimension.Width') print obj.getPropertyValue('Dimension.Height') |
addParent(mesObject)
Add a MES object as a parent to another MES object. MES objects can have children and parents. Depending on the type of MES object determines the types of children or parents that can be added. For example, a material class (MESMaterialClass) object can have material definitions (MESMaterialDef) as children, but material definitions objects cannot have material class objects as children.
Note
When a child is added to an MES object, then a parent reference will be added to the child behind the scenes. Likewise, when a parent is added to a child, a child reference will be added to the parent behind the scenes. This insures if integrity of relationships are maintained.
Add Parent before Naming for Non-Unique Names
Some MES Objects can have duplicate names, such as lines in different areas. However, lines in the same area must have unique names. Ensure that object.addParent() is called before obj.setPropertyValue('Name', 'Non-Unique Name') in any script creating such non-uniquely named equipment that requires distinct parents or paths.
addParent(mesObject)
- Parameters
AbstractMESObject mesObject - An instance to an MES object. An AbstractMESObject object is just the generic form of an MES object when the specific type is unknown.
- Returns
Nothing
- Scope
All
addParent(mesObjectLink)
Add a MES object link as a parent to another MES object. MES objects can have children and parents. Depending on the type of MES object determines the types of children or parents that can be added. For example, a material class (MESMaterialClass) object can have material definitions (MESMaterialDef) as children, but material definitions objects cannot have material class objects as children.
Note
When a child is added to an MES object, then a parent reference will be added to the child behind the scenes. Likewise, when a parent is added to a child, a child reference will be added to the parent behind the scenes. This insures if integrity of relationships are maintained.
addParent(mesObject)
- Parameters
MES Object Link mesObjectLink - A link to an MES object. A MES Object Link holds identification information to a MES object. This is very efficient when displaying MES objects in a list and all the MES object details are not needed.
- Returns
Nothing
- Scope
All
createComplexProperty(complexPropertyType, name)
Create a complex property directly to an MES object by not specifying a path to the parent property.
createComplexProperty(complexPropertyType, name)
- Parameters
String complexPropertyType - The type of complex property.
String name - The name of complex property.
- Returns
The complex property for the specified type (Material Resource Property, Equipment Resource Property, Personnel Resource Property, etc.)
- Scope
All
getAllCustomProperties()
Returns all the custom properties for the definition and any class object that the definition is a member of plus the inherited custom properties as a list of MESCustomProperty objects.
getAllCustomProperties()
- Parameters
None
- Returns
List<MESCustomProperty> - The list of custom properties.
- Scope
All
getChildCollection()
Get the collection of children for an MES object.
getChildCollection()
- Parameters
None
- Returns
MESObjectCollection - Returns a collection object containing references to all children of the MES object.
- Scope
All
getComplexProperty(complexPropertyName, entryName)
Get the collection of complex properties.
getComplexProperty(complexPropertyName, entryName)
- Parameters
String complexPropertyName - The name for the type of complex property.
String entryName - The name of the complex property entry.
- Returns
The complex property collection.
- Scope
All
getComplexProperty(complexPropertyName, index)
Get the collection of complex properties.
getComplexProperty(complexPropertyName, index)
- Parameters
String complexPropertyName - The name for the type of complex property.
Integer index - The specified position in this list.
- Returns
The complex property collection.
- Scope
All
getComplexProperty(path)
Get the collection of complex properties.
getComplexProperty(path)
- Parameters
String path The path to the MES property to get.
- Returns
The complex property for the specified path.
- Scope
All
getComplexPropertyByKind(path)
This method is used to reference properties with various MES object types that have the same property kind and base names.
Options for Kind
- Material
- Equipment
- SupplEquip
- Personnel
Sample MES property paths:
- Material.Vinegar.LotNo - where Material is the kind, Vinegar is the base name and LotNo is the property name.
- Response Material.Vinegar-1.LotNo - where Response Material is the name of the complex property type, Vinegar-1 is the entry name and LotNo is the property name.
getComplexPropertyByKind(path)
- Parameters
String path - The path to the MES property to get. Options for Kind are Material, Equipment, SupplEquip, and Personnel.
- Returns
AbstractMESProperty - An AbstractMESProperty for the specified path.
- Scope
All
getComplexPropertyCount(complexPropertyName)
Get the number of complex properties.
getComplexPropertyCount(complexPropertyName)
- Parameters
String complexPropertyName - The name for the complex property.
- Returns
Integer count - The size of the complex property collection.
- Scope
All
getComplexPropertyItemNames(complexPropertyName)
Gets the list of production item with the specified complex property.
getComplexPropertyItemNames(complexPropertyName)
- Parameters
String complexPropertyName - The name of the complex property.
- Returns
List<String> itemNameList - The list of production item names with the specified complex property.
- Scope
All
getComplexPropertyTypeNames()
Get the complex properties of a specific type.
getComplexPropertyTypeNames()
- Parameters
None
- Returns
A list of complex properties that matches the given type.
- Scope
All
getCoreProperties()
Get the collection of core properties.
getCoreProperties()
- Parameters
None
- Returns
MESPropertyCollection coreProperties - The collection of core properties.
- Scope
All
getCustomProperties()
Returns all of the custom properties of the definition object as an MESPropertyCollection.
getCustomProperties()
- Parameters
None
- Returns
MESPropertyCollection - A collection of the names of custom properties as strings.
- Scope
All
getCustomPropertiesFull()
Return the custom properties for the MES object as a Python dictionary. The Python dictionary will contain custom property path, definition pairs. The definition is a Python list containing the data type, value, description, units, production visible and required settings of the custom property.
Because custom properties can be nested, the path of the custom property is used. Each level of the path is separated with a period. This allows for names to be duplicated provided the path is unique. For example, it is possible for a MES object to have custom properties "Dimension 1.Width" and "Dimension 2.Width"
getCustomPropertiesFull()
- Parameters
Nothing
- Returns
PyDictionary - A Python dictionary containing custom property path (name) definition pairs.
- Scope
All
getCustomPropertiesFull(complexPropertyName, entryName)
Return the custom properties for a complex property of a MES object as a Python dictionary. When the complex properties on a MES object (for example, a material reference) have custom properties, this method is used to get them by type and name. The Python dictionary will contain custom property path, definition pairs. The definition is a Python list containing the data type, value, description, units, production visible and required settings of the custom property.
Because custom properties can be nested, the path of the custom property is used. Each level of the path is separated with a period. This allows for names to be duplicated provided the path is unique. For example, it is possible for a MES object to have custom properties "Dimension 1.Width" and "Dimension 2.Width"
getCustomPropertiesFull(complexPropertyName, entryName)
- Parameters
String complexPropertyType - The name for the type of complex property.
String name - The name of the complex property entry.
- Returns
PyDictionary - A Python dictionary containing custom property path (name) definition pairs.
- Scope
All
getCustomPropertyDescription(propertyPath)
Get the description of the custom property by name or property path.
getCustomPropertyDescription(propertyPath)
- Parameters
String propertyPath - The name or property path of the custom property to get the description for.
- Returns
String description - The custom property description.
- Scope
All
getCustomPropertyEnabled(propertyPath)
Get the enabled state of a custom property. If the enabled state is True then custom property is available. If False, the custom property will not appear in component, be used during production or is not accessible in script.
getCustomPropertyEnabled(propertyPath)
- Parameters
String propertyPath - The name or property path of the custom property to get the enabled state.
- Returns
boolean The enabled state of the custom property.
- Scope
All
getCustomPropertyUnits(propertyPath)
Get the units of the custom property.
getCustomPropertyUnits(propertyPath)
- Parameters
String propertyPath - The name or property path of the custom property to get the description for.
- Returns
String units - The units of the new custom property.
- Scope
All
getCustomPropertyValues(complexPropertyType, name)
Return the custom properties for the complex property (resource reference) as a Python dictionary. The Python dictionary will contain custom property path, value pairs. Because custom properties can be nested, the path of the custom property is used. Each level of the path is separated with a period. This allows for names to be duplicated provided the path is unique. For example, it is possible for a MES object to have custom properties "Dimension 1.Widith" and "Dimension 2.Width".
For response segments, references to resources are created for each lot, person or supplemental equipment. For example, if a segment is started filling tank 1 and then switches to tank 2, then there will be two complex properties. One that has all the information while tank 1 was selected and a second that has all the information while tank 2 was selected. Custom properties can be added to the complex properties that will be unique for the time each tank was selected. If a pH reading is collected for each tank, then the separate readings can be saved in the appropriate complex property. To specify which complex property to access, extended naming is used. Referring to our sample, if we named the material complex property "Liquid", then the extend name for the first entry is "Liquid-1" and the second entry is "Liquid-2".
getCustomPropertyValues(complexPropertyType, name)
- Parameters
String complexPropertyType - The name for the type of complex property.
String name - The name of the complex property entry.
- Returns
PyDictionary - A Python dictionary containing custom property path (name) value pairs.
- Scope
All
getInheritedProperties()
Get properties inherited by the MES object. These inherited properties are custom properties on the parent(s) of the object.
getInheritedProperties()
- Parameters
None
- Returns
MESPropertyCollection - The list of inherited properties.
- Scope
All
getMESObjectType()
Get the type of the MES object. This returns an object that represents the MES object type. This object contains other information associated with the type. In most cases only the name of the MES object type is needed and using the getMESObjectTypeName script function is recommended instead.
getMESObjectType()
- Parameters
None
- Returns
MESObjectType - The type of MES object.
- Scope
All
getMESObjectTypeName()
Get the name of the MES object type.
getMESObjectTypeName()
- Parameters
None
- Returns
String - The MES object type name of the MES object. Refer to: MES Object Type Name.
- Scope
All
getName()
Get the name of the MES object. For each type of MES object, the name must be unique. For example, the name of each material definition is unique. In addition, the MES object name must also be unique for various categories of MES object types.
getName()
- Parameters
None
- Returns
String - MES object name.
- Scope
All
Info
Below are the categories of MES object types that the names will be unique:
|
Category
|
MES Object Types
|
|---|---|
| Equipment | Equipment, EquipmentClass |
| Material, Personnel | MaterialDef, MaterialClass, Person, Personnel Class |
| Operation | Operations Definition, OperationSegment |
getParentCollection()
Get the collection of parents for an MES object.
getParentCollection()
- Parameters
None
- Returns
MESObjectCollection - Returns a collection object containing references to all parents of the MES object.
- Scope
All
getPropertyValue(propertyPath)
Get a property value of an MES object by name or path. The property can be a core property, custom property or complex property of the MES object. In the case where custom properties are nested, a path is required to return the correct value.
The type of the value depends on the property being read. If no value is currently assigned to the property, None will be returned.
getPropertyValue(propertyPath)
- Parameters
String propertyPath - The name or path of the property being read.
- Returns
The value of the property. The type depends on the property being read.
- Scope
All
getUUID()
Return the UUID value from the UUID property of the MES object. UUID stands for Universally Unique Identifier and each MES object will have a UUID assigned.
getUUID()
- Parameters
None
- Returns
String - UUID of the MES object
- Scope
All
getVersion()
Return the version number of the MES object. Not all MES objects have version number. Every time a definition type of MES object is modified, the version number is increased. When new schedules or production is run based on the definition MES object, it is tied the latest version of the definition MES objects.
getVersion()
- Parameters
None
- Returns
Integer - The version number of this MES object.
- Scope
All
isEnabled()
Get the enabled state of the MES object. If an MES object is not enabled, it will not show in any selection list or able to be selected within script. Essentially, the enabled state will change to false when the MES object is deleted. Deleted MES object still reside in the system for history of past production.
isEnabled()
- Parameters
None
- Returns
boolean - The enabled state of the MES object.
- Scope
All
isModified()
If one or more properties of an MES object are changed, then True will be returned.
isModified()
- Parameters
None
- Returns
boolean - The MES object modified state.
- Scope
All
removeChild(mesObject)
Remove another MES child object for an MES object.
MES objects can have children and parents. Depending on the type of MES object determines the types of children or parents that can be added. For example, a material class object can have material definitions (MESMaterialDef) as children, but material definitions objects cannot have material class objects as children.
Note
When a child is removed from an MES object, then the parent reference will be removed from the child behind the scenes. Likewise, when a parent is removed from a child, the child reference will be removed from the parent behind the scenes. This insures if integrity of relationships are maintained.
removeChild(mesObject)
- Parameters
AbstractMESObject mesObject - An instance to an MES object. An AbstractMESObject object is just the generic form of an MES object when the specific type is unknown.
- Returns
Nothing
- Scope
All
removeComplexProperty(complexPropertyName, entryName)
Removes an existing complex property.
removeComplexProperty(complexPropertyName, entryName)
- Parameters
String complexPropertyName - The name for the type of complex property.
String entryName - The name of the complex property entry.
- Returns
Nothing
- Scope
All
removeCustomProperty(propertyPath)
Removes an existing custom property.
removeCustomProperty(propertyPath)
- Parameters
String propertyPath - The path of property to remove.
- Returns
Nothing
- Scope
All
removeParent(mesObject)
Remove another MES parent object for an MES object.
MES objects can have children and parents. Depending on the type of MES object determines the types of children or parents that can be added. For example, a material class object can have material definitions (MESMaterialDef) as children, but material definitions objects cannot have material class objects as children.
Note
When a child is removed from an MES object, then the parent reference will be removed from the child behind the scenes. Likewise, when a parent is removed from a child, the child reference will be removed from the parent behind the scenes. This insures the integrity of relationships are maintained.
removeParent(mesObject)
- Parameters
AbstractMESObject mesObject - An instance to an MES object. An AbstractMESObject object is just the generic form of an MES object when the specific type is unknown.
- Returns
Nothing
- Scope
All
renameComplexProperty(complexPropertyName, entryName, newEntryName)
Renaming an existing complex property.
renameComplexProperty(complexPropertyName, entryName, newEntryName)
- Parameters
String complexPropertyName - The name for the type of complex property.
String entryName - The name of the complex property entry.
String newEntryName - The new complex property name.
- Returns
Nothing
- Scope
All
renameCustomProperty(propertyPath, newName)
Rename an existing custom property.
renameCustomProperty(propertyPath, newName)
- Parameters
String propertyPath - The name or property path of the existing custom property to rename.
String newName - New custom property name.
- Returns
Nothing
- Scope
All
setCustomPropertyDescription(propertyPath, description)
Set the description of the custom property by name or property path.
setCustomPropertyDescription(propertyPath, description)
- Parameters
String propertyPath - The name or property path of the custom property to get the description for.
String description - The custom property description.
- Returns
Nothing
- Scope
All
setCustomPropertyEnabled(propertyPath, enable)
Set the enabled state of a custom property. If set to True then custom property is available. If False, the custom property will not appear in component, be used during production or is not accessible in script.
setCustomPropertyEnabled(propertyPath, enable)
- Parameters
String propertyPath - The name or property path of the custom property to set the enabled state.
boolean enable - The enabled state to set the custom property to.
- Returns
Nothing
- Scope
All
setCustomPropertyUnits(propertyPath, units)
Set the units of the custom property.
setCustomPropertyUnits(propertyPath, units)
- Parameters
String propertyPath - The name or property path of the custom property to get the description for.
String units - The units of the new custom property.
- Returns
Nothing
- Scope
All
setCustomPropertyValues(customProperties)
This method can be used to set custom properties values or create custom properties of an MES object. The format of the customProperties parameter determines if just custom property values will be assigned or custom properties will be created and values assigned.
Because custom properties can be nested, the path of the custom property is used. Each level of the path is separated with a period. This allows for names to be duplicated provided the path is unique. For example, it is possible for a MES object to have custom properties "Dimension 1.Width" and "Dimension 2.Width"
Python dictionary
To just set the custom property values, use a Python dictionary for the customProperties parameter that contains name value pairs.
To create custom properties, use a Python dictionary for the customProperties parameter that contains name definition pairs. The custom property definition is a Python list that contains the settings. The order of the setting must be data type, value, description, units, production visible and required. Optionally, the production visible and required can be left out. If they are left out the default values of production visible = true and required = false will be used.
setCustomPropertyValues(customProperties)
- Parameters
PyDictionary customProperties - A Python dictionary containing custom property path (name) definition pairs.
- Returns
Nothing
- Scope
All
setEnabled(enable)
Set the enabled state of the MES object. By using this script function with parameter of False will delete the MES object. After setting the enabled state to false, the object must be saved for the changes to take effect. At the time the disabled MES object is saved, the name is also modified. This allows for the name to be reused in the future without naming conflicts.
The Enterprise MES Object (your top level in the Production Model) cannot be deleted. It can only be edited.
setEnabled(enable)
- Parameters
boolean enable - The new enabled state to make the MES object.
- Returns
Nothing
- Scope
All
setPropertyValue(propertyPath, value)
Set a property value of an MES object by name or path. The property can be a core property, custom property or complex property of the MES object. In the case where custom properties are nested, a path is required to set the correct value.
The property value is passed as a String, but is converted to the correct data type for the property.
setPropertyValue(propertyPath, value)
- Parameters
String propertyPath - The name or path of the property being written to.
String value - The value to set the property to.
- Returns
Nothing
- Scope
All
Sepasoft MES Module Suite