AnsweredAssumed Answered

workflow aspect variable becoming undefined [SOLVED]

Question asked by jimcornmell on Dec 12, 2007
Latest reply on Mar 28, 2008 by jimcornmell
Hi All,

I'm trying to change aspect properties within a workflow.  I can populate them in java and kickoff the workflow, I can then see the values in the javascript, change change them.  Unfortunately outside of the specific workflow task the value for wf_assigneeInfo is:

org.mozilla.javascript.Undefined@75cb15

Here is the relavent bit of the workflow, you can see I'm changing the value of wf_assigneeInfo and getting the undefined value, even though everything looks in order before and after:

<task-node name="Waiting for Artist">
   <task name="wf:waitingForArtistTask" swimlane="artistsPool">
      <event type="task-assign">
         <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
            <script>
               <variable name="wf_assigneeInfo" access="read,write"/>
               <variable name="wf_studio" access="read"/>
               <variable name="wf_team" access="read"/>
               <variable name="wf_artist" access="read"/>
               <variable name="wf_reader" access="read"/>
               <expression>
                  logger.log("WORKFLOW TASK Create");
                  logger.log("wf_assigneeInfo = " + wf_assigneeInfo);
                  logger.log("wf_studio = " + wf_studio);
                  logger.log("wf_team = " + wf_team);
                  logger.log("wf_artist = " + wf_artist);
                  logger.log("wf_reader = " + wf_reader);
                  wf_assigneeInfo = "GROUP_" + wf_studio + "-" + wf_team + "-Artists";
                  logger.log("wf_assigneeInfo = " + wf_assigneeInfo);
                  logger.log("wf_studio = " + wf_studio);
                  logger.log("wf_team = " + wf_team);
                  logger.log("wf_artist = " + wf_artist);
                  logger.log("wf_reader = " + wf_reader);
               </expression>
            </script>
         </action>
      </event>
   </task>
   <transition name="Send to Artist" to="Create">
      <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
         <script>
            <expression>
               logger.log("init.prop   = " + initiator.properties["cm:name"]);
               logger.log("bpm_wfDesc  = " + bpm_workflowDescription);
            </expression>
         </script>
      </action>
   </transition>
</task-node>

And here is the output when the workflow runs:

16:42:42,765 DEBUG [repo.jscript.ScriptLogger] WORKFLOW TASK Create
16:42:42,765 DEBUG [repo.jscript.ScriptLogger] wf_assigneeInfo = GROUP_Team1
16:42:42,765 DEBUG [repo.jscript.ScriptLogger] wf_studio = Studio1
16:42:42,765 DEBUG [repo.jscript.ScriptLogger] wf_team = Team1
16:42:42,781 DEBUG [repo.jscript.ScriptLogger] wf_artist = artist1
16:42:42,781 DEBUG [repo.jscript.ScriptLogger] wf_reader = reader1
16:42:42,781 DEBUG [repo.jscript.ScriptLogger] wf_assigneeInfo = GROUP_Studio1-Team1-Artists
16:42:42,781 DEBUG [repo.jscript.ScriptLogger] wf_studio = Studio1
16:42:42,781 DEBUG [repo.jscript.ScriptLogger] wf_team = Team1
16:42:42,781 DEBUG [repo.jscript.ScriptLogger] wf_artist = artist1
16:42:42,781 DEBUG [repo.jscript.ScriptLogger] wf_reader = reader1

Is it me or is it hard to use alfresco?  I have to admit I'm finding it slow going….?  :? Anyway as always thanks in advance for any help.

Jim

Outcomes