AnsweredAssumed Answered

Fails to set value of task property type

Question asked by purohitsumit on Dec 9, 2014
Latest reply on Dec 11, 2014 by douglascrp
Hi,

I have been trying to set values of property types defined in task model but values show up as ""
I am trying it in 2 cases:
1. Set value of property with a constant.
2. Set value of property in task#2 based on value received in task#1 using process variables



<startEvent id="alfrescoStartevent1" name="Alfresco start" activiti:formKey="alvexwfat:startTask">
    <!–  Velo_Update Sumit.Purohit@pnnl.gov –>
    <extensionElements>
          <activiti:taskListener event="create" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
            <activiti:field name="script">
              <activiti:string>
              execution.setVariable('alvexwfat_velophaseid', task.getVariableLocal('alvexwfat_velophaseid'));
              </activiti:string>
            </activiti:field>
          </activiti:taskListener>
          <activiti:taskListener event="complete" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
            <activiti:field name="script">
              <activiti:string>execution.setVariable('alvexwfat_velophaseid', task.getVariableLocal('alvexwfat_velophaseid'));
              </activiti:string>
            </activiti:field>
          </activiti:taskListener>
        </extensionElements>
    </startEvent>

    <subProcess id="subprocess1" name="">
      <multiInstanceLoopCharacteristics isSequential="false" activiti:collection="${alvexwfat_subprocessKinds}" activiti:elementVariable="alvexwfat_subprocessKind">
        <completionCondition>${alvexwfat_mainTaskDone}</completionCondition>
      </multiInstanceLoopCharacteristics>
      <exclusiveGateway id="exclusivegateway3" name="Exclusive Gateway"></exclusiveGateway>
      <userTask id="alfrescoUsertask1" name="Perform a Execute task" activiti:assignee="${executeTaskAssignee}" activiti:formKey="alvexwfat:executeTask">
        <extensionElements>
          <activiti:taskListener event="create" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
            <activiti:field name="script">
              <activiti:string>
              task.setVariableLocal('alvexwfat_testval','bla  bla again testval');
               task.setVariableLocal('alvexwfat_velophaseid', execution.getVariable('alvexwfat_velophaseid'));

</activiti:string>
            </activiti:field>
          </activiti:taskListener>
          <activiti:taskListener event="complete" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
            <activiti:field name="script">
              <activiti:string>task.setVariableLocal('alvexwfat_velophaseid', "exectask phaseid complete");
            </activiti:field>
          </activiti:taskListener>
        </extensionElements>
      </userTask>



but instead, i get  :

 

alvexwfat_testval
   
   ""
alvexwfat_velophaseid
   
   ""


Am i doing it wrong ?

Thanks
Sumit

Outcomes