cancel
Showing results for 
Search instead for 
Did you mean: 

javascript transactions

punk
Champ in-the-making
Champ in-the-making
I am writing a javascript which is triggered with an alfresco-rule that runs un background behind a folder in the repository when a file is uploaded.
My problem is that I can't manage the transaction into my javascript.
Even If i catch an error the whole transaction is completely rolled back.
Maybe the solution is to run some part of the script inside a ScriptAction that will be execute through executeAsynchronously() method as described here:
http://docs.alfresco.com/4.0/index.jsp?topic=%2Fcom.alfresco.enterprise.doc%2Freferences%2FAPI-JS-Sc...

But I can't find how to call or instantiate a ScriptAction from my javascript.
Someone can help?

Thanks in advance.
DR
1 REPLY 1

punk
Champ in-the-making
Champ in-the-making
Ok I find out how to call asynchronous script actions in this way:


   var scriptAction = actions.create("script");
   var jsNode = companyhome.childByNamePath("Dizionario dei dati/Script/handle_error.js");
   scriptAction.parameters["script-ref"] = jsNode;
   scriptAction.executeAsynchronously(jsNode);

But if I can't have a callback this is not useful for my purposes.
Someone can help?