I would like to run some DXL after a drag-and-drop event (e.g. a copy objects operation) between objects in a formal module. This DXL needs info about objects dragged and the object that is the target of the "drop". I have no troubles getting the drag info. However, "drop" trigger does not appear to fire upon a "drop" within same instance of DOORS. Side note: the drop event does fire, upon drag and drop between module objects opened via two different instances of DOORS but this doesn't meet my need. I would very much appreciate ideas on an approach that might meet my objective.
BobSherman - Sun Aug 23 14:00:48 EDT 2015 |
Re: Drag-and-Drop Trigger Events From Objects to Objects The drop event is not designed to work as you expect ;) Have a look in the help - > "Triggered when data is dragged from another application and dropped onto a displayed formal module object"
But you can:
void code_post_trigger(Trigger t){
Object o = object(t)
if (null o) return
oleSetResult( probeAttr_(o, "absolute number") "" )
}
void code_post_sync(Trigger t){
Object o = object(t)
if (null o) return
string sourceObjID = oleGetResult()
if (sourceObjID"" == "" ) return
print "Getting data from " sourceObjID " into " probeAttr_(o, "absolute number") "\n"
oleSetResult("")
}
Trigger t = trigger(project->module->"/ESPACE TEST DOORS/pommCannelle/essai 3"->object, drag, 5, code_post_trigger )
if ( ! null t) log "trigger on the drag OK\n"
else log "trigger on the drag NOK\n"
t = trigger(project->module->"/ESPACE TEST DOORS/pommCannelle/essai 3"->object, sync, 5, code_post_sync )
if ( ! null t) log "trigger on the sync OK\n"
else log "trigger on the sync NOK\n"
|
Re: Drag-and-Drop Trigger Events From Objects to Objects pommCannelle - Mon Aug 24 06:08:27 EDT 2015 The drop event is not designed to work as you expect ;) Have a look in the help - > "Triggered when data is dragged from another application and dropped onto a displayed formal module object"
But you can:
void code_post_trigger(Trigger t){
Object o = object(t)
if (null o) return
oleSetResult( probeAttr_(o, "absolute number") "" )
}
void code_post_sync(Trigger t){
Object o = object(t)
if (null o) return
string sourceObjID = oleGetResult()
if (sourceObjID"" == "" ) return
print "Getting data from " sourceObjID " into " probeAttr_(o, "absolute number") "\n"
oleSetResult("")
}
Trigger t = trigger(project->module->"/ESPACE TEST DOORS/pommCannelle/essai 3"->object, drag, 5, code_post_trigger )
if ( ! null t) log "trigger on the drag OK\n"
else log "trigger on the drag NOK\n"
t = trigger(project->module->"/ESPACE TEST DOORS/pommCannelle/essai 3"->object, sync, 5, code_post_sync )
if ( ! null t) log "trigger on the sync OK\n"
else log "trigger on the sync NOK\n"
You delivered a solution that work perfectly for what I described. Thanks very much for that! However, I must apologize because I see now that my post/request did not include a key requirement. That requirement is that I must also be able to generate the events when dragging objects between modules. Further, in this case the destination object for the "drop" could be the same object upon two consecutive different (difference sources) "drag" events; thus the sync trigger would not fire in this case. Example: |
Re: Drag-and-Drop Trigger Events From Objects to Objects BobSherman - Mon Aug 24 07:34:39 EDT 2015
You delivered a solution that work perfectly for what I described. Thanks very much for that! However, I must apologize because I see now that my post/request did not include a key requirement. That requirement is that I must also be able to generate the events when dragging objects between modules. Further, in this case the destination object for the "drop" could be the same object upon two consecutive different (difference sources) "drag" events; thus the sync trigger would not fire in this case. Example: Hi !
I'm afraid you have to add a click to do what you need ;)
Feel free to post your code if you are in trouble ;) |
Re: Drag-and-Drop Trigger Events From Objects to Objects pommCannelle - Mon Aug 31 04:44:38 EDT 2015 Hi !
I'm afraid you have to add a click to do what you need ;)
Feel free to post your code if you are in trouble ;) After thinking more about "requirements"... I realized that the utility should include creating links between the objects copy-dragged across modules (to show their ancestry). This opened up an option for a new approach; that approach is to create a DXL attribute to capture links on the object and set trigger to fire on change of that attribute (i.e. after link creation). So rather than dragging the objects, the use case is now do a "copy & link" step, which then allows me to do the needed post processing (after the object copy). In any case, thanks so much for your help. All of your suggestions were insightful and feasible. Side note: your drag-and-drop example code taught me a lot about that functionality. Thanks again! |