Hi there,
I have a rule on a folder that executes some custom javascript.
The rule is triggered:
"When items are created or enter this folder"
and
"When items are updated"
I want my script to behave slightly differently for each event.
Does anyone know if it is possible to detect which event triggered the script or do I need to create 2 separate rules and scripts?
Thanks
Paul
Hi Paul,
I don't think there is a handle or something else for the triggering event, but you can set/check a special property on the triggering object. For example a document action triggers the event,
you could also check the modified an created date time - if modified is newer than created, it was a update/change event. (if created is newer than modified, shut down your whole network )
Maybe thats more work than to handle two separate events... but...
regards,
Martin
Or another option would be to use behaviors instead, and then you will be able to detect what caused the execution, and even more details like, the properties that got changed, including the before and after values.
Thanks Martin
Thanks Douglas
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.