Hello
Is there a way to show a user the output of the rule?
Let's say the rule checks content data on file upload and deletes it when it doesn't meet the criteria. How to inform the user that his file was deleted because of the <custom rule's message>?
I know I can easily show popup by executing Alfresco.util.PopupManager.displayPrompt() but rules run on server-side Javascript which doesn't have this functionality.
Hi @upforsin
I don't believe this is possible, because as you say, rules run on the server side, can run asyncronously, and have no return type, while Share runs client side - there seems to be no mechanism for reporting results between them .
HTH
Hi @EddieMay
I cannot do it directly but what if i.e. the rule would call a Share webscript which would then display a popup? Just loud thinking
Hi @upforsin
I don't know is the honest answer. However, how would you know that the rule had completed if there is no return value & if the rule is run asyncronously?
Cheers,
Share Web Scripts can't show pop ups, they are also server side code.
The rule might be implemented in Java, so before the function's end it should send the message to the frontend, like: "Hey Share, let's display a popup now".
I was counting on Share webscripts but @angelborroy proved me wrong.
For now, I am just throwing an AlfrescoRuntime exception with my custom message. It works but it doesn't seem like an elegant solution. I'll update this post when I figure something out. Thanks for the help @EddieMay @angelborroy .
Anyway, sending a message from backend to frontend.. it feels to me like it should be a basic task
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.