Do I add JavaScript code to a file rule?

cancel
Showing results for 
Search instead for 
Did you mean: 
viperboys
Active Member II

Do I add JavaScript code to a file rule?

Hi guys,

I want to know how to add JavaScript code to a file rule. My main idea is to execute a post method to send data to other software. I already have everything configured but it doesn't recognize the JavaScript code. I am following these steps. https://hub.alfresco.com/t5/alfresco-content-services-forum/call-external-class-by-javascript-in-rul...

Is there a simpler tutorial or another way to do it? I thank you for all your collaboration. Thank you.

2 Replies
angelborroy
Alfresco Employee

Re: Do I add JavaScript code to a file rule?

From https://docs.alfresco.com/community/references/rule-actions.html

Execute script Runs a custom JavaScript script from the Data Dictionary/Scripts folder. There are a number of sample scripts available. The list can vary depending on how Alfresco Community Edition is configured for your organization.

 

https://docs.alfresco.com/community/concepts/API-JS-intro.html

Hyland Developer Evangelist
viperboys
Active Member II

Re: Do I add JavaScript code to a file rule?

Hi @angelborroy 

Thank you very much for you helping.. 

I added my file in Data Dictionary/Scripts also Also I configure the rule to run my JS file. My problem is that any JS command that I add to the JS file gives me error. For example. I add just console.log ("Work Fine"); and this gives me error. I would like to know how I have to add the JS code in my file rules. And if possible a use case.