ArasLabs / mbom-export

This project adds an export action to the Process Plan item provided by the Aras Manufacturing Process Planning application.
MIT License
3 stars 4 forks source link

Avoid use of keyed_name, use id instead #8

Open AngelaIp opened 5 years ago

AngelaIp commented 5 years ago

Hi Eli,

this one is a real excellent project! It´s highly reusable and does many things just right! But I run into an conceptional issue. I am sorry for the following question, because it´s probably hard to answer. I acutally planned to ask about this since months, but didn´t know where to place the request.

I was forced to change the following in the code to get the project working: labs_GetMBOMData - around line 27: image In my case, I use the item_number in the MBOM, but the Part keyed_name contains item_number and revision information. Of course using the item_number like I did above is not a solution, as the MBOM export will deliver wrong results when exporting MBOMs that use previous part revisions. But from my POV, neither the item_number nor keyed_name are unique indentifiers. Both are not the best choice to select a destinctive part.

I noticed that Aras increasingly uses the keyed_name property as item selector instead of the id. But the increasing use of keyed_name instead of id is a real problem. I already had corrupted data caused by this one. I right now use many addtional code for handling the keyed_name on various events (copy item, version item, ...). This amount of work wasn´t necessary in the past. Previous concepts used standard ids in combination with keyed_name attribute as display value. I do not fully understand why Aras changed that proven approach.

Many of the newer Aras features solely rely on the keyed_name. This forces users to use more precise keyed_name for items. But guaranteeing uniqueness of an item is not the job of the keyed_name. Is this really how it´s intended to be?

To break down my long text to simple questions.

Many thanks for the project! Sorry for this question! Angela

EliJDonahue commented 5 years ago

Hi Angela,

How can we solve this on ein the project?

For this project, we can tweak the code to use the part id instead of keyed name or item number. I hadn't considered a case where the Part ItemType's keyed_name wasn't the item number. You are also correct about needing the id to get the correct version of the part. The code will need to be tweaked to ensure the specific version is returned and not the latest.

What is Aras masterplan regarding the keyed_name?

I can't answer regarding Aras' master plans. However, I can advise the Labs team to be more conscious of which properties we use to query and display data for our community projects.

Eli

Edited for formatting.

AngelaIp commented 5 years ago

Hi Eli, Many new featuers are very keyed_name depended. Maybe you have the possibility to adress this topic to a more general instance? Of course there might be some use cases, were we need to use the keyed_name. But it would be cool, if OOTB Aras could be more id friendly as this would make daily live a lot easier. Maybe the main problem is the Makerbot sample that all Aras employees use for testing. It´s just does not contain enough special use cases :smirk:

Angela