Skip to end of metadata
Go to start of metadata

This issue should be corrected automatically in SP 5 and later versions.


Problem

After upgrading from pre SP3 versions on the MES 2.0 platform (that is to say 2.79.0 SP2/2.80.0 SP2 or earlier), you can find yourself not able to start operations that use the <any equipment> or the <any material> classes in their configuration. You will see an error message:

Based on the definition, the equipment that this operation can execute on (yourLineName)
must belong to the (<any equipment>) equipment class but doesn't.

This is caused by a duplicate entry created in the database for these classes. You can verify this by running the following query:

SELECT * FROM MESEquipmentClass where name like '%any equipment%' and enabled = 1 order by timestamp desc
SELECT * FROM MESMaterialClass where name like '%any material%' and enabled = 1 order by timestamp desc

If you get a single row, then this Knowledge Base article does not apply, and you should look elsewhere to troubleshoot your issue.If you get more than 2 rows, then you should reach our directly to Sepasoft support, as this is invalid, and this article also does not apply.

If you have 2 rows, you may notice that the name column is different, the older entry has the '<' and '>' characters escaped and the new one does not.

Solution

This solution requires making changes directly on the database tables. While it has been tested, minor mistakes or deviations from the procedure could prove difficult if not impossible to reverse. You should have database and gateway backups taken prior to continuing in case anything, however unlikely, were to occur.

A series of update queries need to be run to repair this.Your operations are defined referring to the older entry, but the system does not recognize the escaped characters anymore. We need to disable the new entry and rename the old one so that the system is able to see it correctly.

In order to repair the <any equipment> class:

UPDATE MESEquipmentClass SET enabled = 0 where Name = '<any equipment>'
UPDATE MESEquipmentClass SET Name = '<any equipment>' where name = '&lt;any equipment&gt;'

For the <any material> class:

UPDATE MESMaterialClass SET enabled = 0 where Name = '<any equipment>'
UPDATE MESMaterialClass SET Name = '<any material>' where name = '&lt;any Material&gt;'


We also need to update the object link table so that the references are pointing to the correct objects.

For <any equipment>:

update MESObjectLink set mesobjectname = '<any equipment>removed' where mesobjectname = '<any equipment>'
update MESObjectLink set mesobjectname = '<any equipment>' where mesobjectname = '&lt;any equipment&gt;'

For <any material>:

update MESObjectLink set mesobjectname = '<any material>removed' where mesobjectname = '<any material>'
update MESObjectLink set mesobjectname = '<any material>' where mesobjectname = '&lt;any material&gt;'

At this point, you should test that your operations are running correctly. It is possible that you may have to call system.mes.invalidateCache, or restart the module.


You may notice that we simply renamed the new object, and that you will still be able to see it from your configuration screen.This is done in case there are any mistakes, since we are easily able to revert any changes at this point. If you would like to remove the entry from consideration, you can set the new entry as disabled from script. This can be run from the scripting console:

# Fixing the unwanted <any equipment> entry
eqClass = system.mes.loadMESObject('<any equipment>removed', 'EquipmentClass')
eqClass.setEnabled(False)
system.mes.saveMESObject(eqClass)

# Fixing the unwanted <any material> entry
matClass = system.mes.loadMESObject('<any material>removed', 'MaterialClass')
matClass.setEnabled(False)
system.mes.saveMESObject(matClass)

At this point, you should no longer see the option in the menus, and you should still be able to run your operations.

  • No labels