cancel
Showing results for 
Search instead for 
Did you mean: 

Signal a node to the next with Alfresco JavaScript

chicco0386
Champ on-the-rise
Champ on-the-rise
Hi all,
I want to execute an action inside a node and after continue with the workflow cilcle.
My node is this.

<node name="Controlla se il template PPT esiste">
      <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
         <runas>admin</runas>
         <script>
            <variable name="templateExist" access="write"></variable>
            <variable name="alfrescoPathTriaTemplate" access="read"></variable>
            <variable name="companyhome" access="read"></variable>
            <expression>
               try {
                  logger.log("node [Controlla se il template PPT esiste], entrato con path ["+alfrescoPathTriaTemplate+"]");
                  var templateExist = companyhome.childByNamePath(alfrescoPathTriaTemplate);
                  var exist;
                  if (templateExist == null){
                     logger.log("node [Controlla se il template PPT esiste], NON ho trovato nessun template al percorso ["+alfrescoPathTriaTemplate+"]");
                     exist = false;
                  } else {
                     logger.log("node [Controlla se il template PPT esiste], ho trovato il template al percorso ["+alfrescoPathTriaTemplate+"]");
                     exist = true;
                  }
                  templateExist = exist;
                  executionContext.getToken().signal();
               } catch (e){
                  logger.log("transition [Decidi numero e nome progetto], error durante l'esecuzione dello script " + e);
               }
            </expression>
         </script>
      </action>
      <transition to="Il template esiste?"></transition>
   </node>

The problem is when I try to signal the node, I get this exception:

2010-12-16 18:13:16,931 INFO  [STDOUT] 18:13:16,931 User:enrico_z DEBUG [repo.jscript.ScriptLogger] transition [Decidi numero e nome progetto], error durante l'esecuzione dello script JavaException: org.jbpm.graph.def.DelegationException: org.jboss.soa.esb.services.jbpm.actionhandlers.EsbActionHandler cannot be cast to org.jbpm.graph.def.ActionHandler

Can you help me please?

Thank you.
3 REPLIES 3

chicco0386
Champ on-the-rise
Champ on-the-rise
Anyone can help me?

PLEASE
Thank you

mitpatoliya
Star Collaborator
Star Collaborator
I am not sure about the way you are doing.
But transition from one node to another can be achived easily by using action classes.
Better you go for that approch.

chicco0386
Champ on-the-rise
Champ on-the-rise
I am not sure about the way you are doing.
But transition from one node to another can be achived easily by using action classes.
Better you go for that approch.

Thank you for the response, but can you give me an example?

THANK YOU