Log changes made by Batchloader on part history

Hi. When I create and then release an ECN, I can see some descriptions and comments if I go to Views/History. However, I would like to find a way to also add some description on the History of the part when I use the batchloader to update any part properties. Is there a way to accomplish this?

Also, I am wondering if there is a way to also add comments when a manual change has been made (let's say, a manual release of a part, or manually promoting a part due to unforeseen circumstances).

Thanks in advance!

PMateo

  • For manual release you could use the "Get Comment" checkbox in Lifecycle transitions. This gives user a prompt to enter a history entry. As far as I remember this doesn´t work for promotion triggered by Innovator itself. But as you want to track manual promotions it would be worth a try.

    Regarding Batchloader this is a use case I would also be interested in. It´s on a very basic way possible track whenever somebody logs in with an non-browser based application like BatchLoader. So you might create an server Method that checks if users comes from an external tool and write History entries by yourself.

    But that’s just a small brainstorming without any testing! There might be better options available already!

  • Sorry for the delay, I got busy. Thanks a lot! Yes, we would like to track manual promotions, its a shame there is not a native way to include comments in the part history from the batch loader but I will look into server methods. I will keep you posted if I find a different way to get around this. Thanks for your help.

    Pmateo

  • Hi pmateo,

    I am not sure if I remember things right. But I think for promotion you can add comments via the batch loader. This one is not tested, but maybe works:

    <Item type="Manufacturer Part" action="promoteItem" where="item_number='@1'">
    <state>@2</state>
    <comments>@3</comments>
    </Item>

    You just cannot add history comments when you add or edit new items.

  • Hello Angelalp,

    I see, thanks a lot for your suggestion! I will try to "promote" an item without creating a new version/revision (hopefully the version = "0" attribute can be used here similar to how you can update a versionable item) and add the comments that way. I am interested in those comments just for tracking purposes, so this may work. Once I test it I will let you know. 

    Kind regards,

    Pmateo

  • I forgot to get back to you; this worked like a charm. The issue of not adding comments when you add or edit is still there, but if the part is not new I am planning to create a new lifecycle state, promoting the part to that state, adding comments in part history, then reverting back to the previous state. Not elegant by any means, but I don't want to edit SQL tables just to add comments. Whenever I have a chance I will look for a better alternative and let you know.

    Thanks,

    Pmateo

  • Hi pmateo,

    maybe we can use a second batchloader query to add history entries after performing add/edit queries.

    The main challenge is that we have to know all required history data when we prepare the batch loader data file. But than something like this may work (not tested)

    [deleted by author]

    I will give it a try next time I do a add/edit action via batch loader.

  • Hello,.

    I see, this looks promising indeed, even with the challenge of having to know all required data when creating the data file. I will test this in the next few hours and let you know how it goes. Thank you very much! This looks much more elegant than updating the item to a new "state" and then reverting back the state to the original just to leave comments in history. 

  • Hi Pmateo,

    I do not expect that my sample will work easily. One problem will be the identity that is required for writing History Items. In my case I was only able to write History entries, when I directly used the History Daemon Identity.

    I right now use a separate Method for writing History entries. It´s similar to the one I posted in this thread:
    https://community.aras.com/f/development/6232/how-to-add-history-using-a-custom-method

    The shown Method is not perfect, but it basically shows how to write history entries. I use this Method with "applyMethod". But I wasn´t able to use this Method from the batch loader. But it would be cool if we somehow could build a Method that is able to work from batchloader too. 

    @Aras-Team: Do you know a way of how we can call custom a Method from the Batchloader? Is this possible at all? Right now I just was able to use standard actions like "get", "edit", "promoteItem", ... . I guess these actions are defined somewhere in a codetree file.  Is it possible that we add our own custom actions?

  • Hi,

    Thanks once again for your ideas and suggestions, they have helped me a lot. I will test this method as well and see. You are right, at first I believed I was using the methods I have developed (only 3 so far but getting there) wrong with the batchloader, but after testing with Nash they worked just fine so I realized the batchloader is limited to basic standard operations, which is a shame. I will keep you posted once I implement the two methods you suggested.

  • Hello! A long overdue update, but this is doing the trick for me. I must know the revision, state and generation in advance so I first have to look at the history table, but so far it's working. I followed  the thread you suggested as well and tried to modify the method  you posted, but I keep getting "not a single item" errors so eventually I  decided to give it another try after I have a few hours to spare.

    Long story short, thanks a lot for your suggestions! Kind regards,

    Pmateo