This issue should be corrected automatically in SP 5 and later versions.
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:
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.
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:
For the <any material> class:
We also need to update the object link table so that the references are pointing to the correct objects.
For <any equipment>:
For <any material>:
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:
At this point, you should no longer see the option in the menus, and you should still be able to run your operations.