Hi, Is there anyway to detect all the modified ro new objects in a module. I have the following situation: The user opens a module, edits/creates some objects. When he closes the module i have to create a link between new/edited objects to another object in a different module. For that i need to identify all the new/edited objects. I have tried with history but with no luck.
Thanks a lot in advance.
doorsuse - Thu Apr 25 06:40:19 EDT 2013 |
Re: Detect modified or new objects in a module Why didn't you have luck in using the history? There is a session number inside and so you have to check an integer value only. Sorry actually I've no doors and cannot post a code snippet. |
Re: Detect modified or new objects in a module Wolfgang Uhr - Thu Apr 25 06:43:36 EDT 2013 Why didn't you have luck in using the history? There is a session number inside and so you have to check an integer value only. Sorry actually I've no doors and cannot post a code snippet. I can extract the session number (which is an int), but how do i know if the session is newly created (since the module has been opened) For eg: Session Modified .... 1 2 3 I would extract session number as 3, let us assume 2,3 are from today which have already been processed. Since then there has not been any chnage. How would i know in that case? what i wanted to do is to save the session number when the module is opened, and then while the module is being closed to check the session number. If it is greater than the earlier saved number then there is some modification. I was not successful because i didnt know how to save this session number in between two dxl scripts |
Re: Detect modified or new objects in a module doorsuse - Thu Apr 25 07:47:03 EDT 2013 I can extract the session number (which is an int), but how do i know if the session is newly created (since the module has been opened) For eg: Session Modified .... 1 2 3 I would extract session number as 3, let us assume 2,3 are from today which have already been processed. Since then there has not been any chnage. How would i know in that case? what i wanted to do is to save the session number when the module is opened, and then while the module is being closed to check the session number. If it is greater than the earlier saved number then there is some modification. I was not successful because i didnt know how to save this session number in between two dxl scripts I do not really understand what you are trying to accomplish, but if you want to store the session number for your script, I would store it in a module attribute. Just create an integer attribute and overwrite it everytime you made sure, that you got all the changes. Note: a new session is only generated when you open the module in exclusive or shareable edit mode, not when you open the module read only! |
Re: Detect modified or new objects in a module The easiest way I found to find new/modified objects is to just use the last modified date. Set a filter to only show objects that were last modified after a certain date. Of course, this is assuming you know what date to use. Maybe that is the concern? If your only interested in new objects and not modified objects, then you can loop through the filtered objects history to see if it was a new object at the last modified date. Embedding a session number or some other kind of semiphore (we use a change request number in an attribute) is only as good as the person putting it in when they make changes. Greg |
Re: Detect modified or new objects in a module The easiest way I found to find new/modified objects is to just use the last modified date. Set a filter to only show objects that were last modified after a certain date. Of course, this is assuming you know what date to use. Maybe that is the concern? If your only interested in new objects and not modified objects, then you can loop through the filtered objects history to see if it was a new object at the last modified date. Embedding a session number or some other kind of semiphore (we use a change request number in an attribute) is only as good as the person putting it in when they make changes. Greg |
Re: Detect modified or new objects in a module doorsuse - Thu Apr 25 07:47:03 EDT 2013 I can extract the session number (which is an int), but how do i know if the session is newly created (since the module has been opened) For eg: Session Modified .... 1 2 3 I would extract session number as 3, let us assume 2,3 are from today which have already been processed. Since then there has not been any chnage. How would i know in that case? what i wanted to do is to save the session number when the module is opened, and then while the module is being closed to check the session number. If it is greater than the earlier saved number then there is some modification. I was not successful because i didnt know how to save this session number in between two dxl scripts 1. If you want to find the sessions of the last day then you can use the "Last Modification Date". This value does not provide the time only the date and so you cannot use it only to find the changes in the last session. 2. How can you find the value? -> There is a history in the module. You should have a look to the history viewer http://www.smartdxl.com/content/?page_id=125. This may help you. |
Re: Detect modified or new objects in a module You have some sort of pre-save Module trigger to do the linking? Date session() tells you the date the current session began. HistorySession hs; for hs in mod do{date datHS = when(hs); int numHS = number(hs)} tells you which session started when. Compare to the date of the current session and you know which HistorySession to look for in History. For Shared modules I believe the Sessions and the History may be OUT of cronological order so looking for the "LAST" session might not work. -Louie |
Re: Detect modified or new objects in a module llandale - Thu Apr 25 16:36:11 EDT 2013 You have some sort of pre-save Module trigger to do the linking? Date session() tells you the date the current session began. HistorySession hs; for hs in mod do{date datHS = when(hs); int numHS = number(hs)} tells you which session started when. Compare to the date of the current session and you know which HistorySession to look for in History. For Shared modules I believe the Sessions and the History may be OUT of cronological order so looking for the "LAST" session might not work. -Louie > For Shared modules I believe the Sessions and the History may be OUT of cronological order so looking for the "LAST" session might not work. In this case you have to store the "last investigated session id" in a modul attribute? |
Re: Detect modified or new objects in a module Wolfgang Uhr - Fri Apr 26 02:35:15 EDT 2013 > For Shared modules I believe the Sessions and the History may be OUT of cronological order so looking for the "LAST" session might not work. In this case you have to store the "last investigated session id" in a modul attribute? You can't change module attributes in shareable edit mode |