MES Object Link

Sepasoft MES Module Suite

MESObjectLink

The MESObjectLink object is a light weight version of an MES object.  Think of it as a defined set of common information linked to the full MES object. Using a reference is faster for the operator and less costly to the server.

When only general information about an MES object is needed instead of the full details of the MES object, you can use the MESObjectLink.

You can load the MESObjectLink reference that includes Name and Type of object in a component, such as MES Object Selector, to reduce the number of entries that populate in the UI. 

MESObjectLink Creation

  • system.mes.object.link.create(mesObject)

  • system.mes.object.link.create(mesObjectType, mesObjectUUID)

  • system.mes.object.link.create(mesObjectType, mesObjectUUID, name)

  • system.mes.object.link.create(mesObjectTypeName, mesObjectUUID)

  • system.mes.object.link.create(mesObjectTypeName, mesObjectUUID, name)

Create a MESObjectLink

Python
#From the MESObjectLink object the full MES object can be loaded by calling the getMESObject() method.
mesObject = mesObjectLink.getMESObject()

Use

The following scripting functions use this object as well as a number of components.

Properties

Inherits properties from: AbstractMESObject

No specific object properties

Object Functions

The following functions are available. This object also Iiherits functions from the AbstractMESObject functions.


 getMESObject()

Description

Returns MES object associated with a MESObjectLink object. If the MES object has not been previously loaded, it will be loaded. 

Syntax

getMESObject()

  • Parameters

None

  • Returns

AbstractMESObject - The MES object associated with the event.

Code Examples
Code Snippet
Python
#Example
objLink = system.mes.object.link.create('ProcessSegment', '4c8edc76-d08b-4838-9e3f-562151eecfa0')
print objLink.getMESObject()

Output
ProcessSegment (4c8edc76-d08b-4838-9e3f-562151eecfa0, Receive Steel, 1 parents, 0 children, 1 custom properties, 4 complex properties)

 getMESObjectType()

Description

Returns type of MES object.

Syntax

getMESObjectType()

  • Parameters

None

  • Returns

MESObjectTypes type - The type of MES Object.

Code Examples
Code Snippet
Python
#Example
obj = system.mes.loadMESObject('57290b1b-c734-404a-bc0f-af0f5e4d2a91')
objLink = system.mes.object.link.create(obj)
print objLink.getMESObjectType()

Output
Material Class

 getMESObjectUUID()

Description

Returns MESObject UUID that this MESObjectLink object is set to.

Syntax

getMESObjectUUID()

  • Parameters

None

  • Returns

String UUID - The unique identifier that represents the MES object.

Code Examples
Code Snippet
Python
#Example
matCls = system.mes.loadMESObject('Turkey', 'MaterialClass')
objLink = system.mes.object.link.create(matCls)
print objLink.getMESObjectUUID()

Output
57290b1b-c734-404a-bc0f-af0f5e4d2a91

 hasMESObject()

Description

Returns True if MES object has been loaded into this MESObjectLink. This will be the case either after the system.mes.create(mesObject) constructor or the getMESObject() property of a MESObjectLink object has been called.

Syntax

hasMESObject()

  • Parameters

None

  • Returns

Boolean True if an MES object exist for the MES object link and False otherwise.

Code Examples
Code Snippet
Python
#Example
obj = system.mes.loadMESObjectByEquipmentPath('[global]\My Enterprise\California\Receiving\Unload Station 1')
objLink = system.mes.object.link.create(obj)
print objLink.hasMESObject()

Output
True

 hasMESObjectInfo()

Description

Returns True if MES object information exists. This includes the MES object type and UUID. The name is not required for this property to return True.

Syntax

hasMESObjectInfo()

  • Parameters

None

  • Returns

Boolean True if information exist for MES object and False otherwise.

Code Examples
Code Snippet
Python
#Example
objLink = system.mes.object.link.create('MaterialDef', 'Box')
print objLink.hasMESObjectInfo()

Output
True

 hasName()

Description

Returns True if the MES object name is available.

Syntax

hasName()

  • Parameters

None

  • Returns

Boolean True if the name of MES object is available and False otherwise.

Code Examples
Code Snippet
Python
#Example
obj = system.mes.loadMESObjectByEquipmentPath('[global]\My Enterprise\California\Storage\Vinegar Tanks\Vinegar Tank 1')
objLink = system.mes.object.link.create(obj)
print objLink.hasName()

Output
True

Description

This clears the previously loaded MES object associated with this MESObjectLink. This can be used to reuse a MESObjectLink object.

Syntax

invalidateMESObject()

  • Parameters

None

  • Returns

Nothing

Code Examples
Code Snippet
Python
obj = system.mes.loadMESObject('Red Wine', 'MaterialDef')
objLink = system.mes.object.link.create(obj)
objLink.invalidateMESObject()
print objLink.hasMESObject()

Output
False

Object Events

Objects have events associated with them that allow for custom scripts to be added whenever the event occurs. Refer to   for more information.

This object inherits the   AbstractMESObject events.

No other object events are available.

Sepasoft MES Module Suite