In your routine that is called based on the reactor for activation (renamed here from epcdchange), add an if statement
Code:
(defun WJ:EPToBeActivated (ObjArg ListArg) ;To use in a reactor, you need two arguments added to your code
(if (not blnFlag)
(progn
(setq blnFlag t)
Do the rest of your command...
)
)
)
Create another routine for the deactivation
Code:
(defun WJ:EPToBeDeactivated (ObjArg ListArg)
(if blnFlag
(setq blnFlag nil)
)
)
Then add your reactor for activation
Code:
(vlr-docmanager-reactor
"WJ:EPToBeActivated"
'((:vlr-documentToBeActivated . WJ:EPToBeActivated))
)
And one for deactivation
Code:
(vlr-docmanager-reactor
"WJ:EPToBeDeactivated"
'((:vlr-documentToBeDeactivated . WJ:EPToBeDeactivated))
)
And using irneb's code for removal of the reactors
Code:
(setq rlst (vlr-reactors))
(foreach item rlst
(foreach ro (cdr item)
(if (member (vlr-data ro) '("WJ:EPToBeActivated" "WJ:EPToBeActivated"))
(vlr-remove ro)
)
)
)