cancel
Showing results for 
Search instead for 
Did you mean: 

taskInstance.id in workflow js

akudinov
Champ in-the-making
Champ in-the-making
I try to use javascript in transition action:


<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
        <script>
             log.debug( "task_id:" + taskInstance.id)
        </script>


but I have exception, when I execute this step in workflow. In log I can't  see any exceptions Smiley Sad

Where is my problem ?
2 REPLIES 2

akudinov
Champ in-the-making
Champ in-the-making
more information:

alfresco 3.4e (windows 7, postrgee)
workflow engine: jbpm

mlauer
Champ in-the-making
Champ in-the-making
Hi,

i have had the same problem. The following code ist now executed without any errors. Although there are variables to build the URL to the workflow:

<event type="task-create">
         <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
            <script>
                    <variable name="taskId" access="write"/>
               <expression>
                                               taskId = taskInstance.id;                                             <!– ID actual worflow-task
                                               var procId = executionContext.processInstance.getId(); <!– ID  workflow-process –>
                                               var host     = urls.share.host;
                                               var protocol = urls.share.protocol;
                                               var port     = urls.share.port;
                                               var context  = urls.share.context;
                  if (logger.isLoggingEnabled()) logger.log(">>> Start Workflow - Task: jbpm$" + taskId  + " Workflow: jbpm$" + procId + "\n");
                  if (logger.isLoggingEnabled()) logger.log(">>> host: " + host  + ":" + port + " Protocol: " + protocol + " Context: " + context + "\n");
               </expression>
            </script>
         </action>
      </event>