AnsweredAssumed Answered

Display variables control in a Form

Question asked by fstnboy on Jun 2, 2016
Latest reply on Jun 3, 2016 by fstnboy
Hi,

I'm using the Activiti6Beta2 community version.

I'm trying to display the value of some variables in a form. For this, I'm the display value control and setting the variable name as "${myVar}".

It seems like it works for a variable that's been set in the start form. But for variables created within the process it doesn't work.

I've got the following ScriptTask to set process variables, and I've printed the values at a later stage and they are set properly:


<scriptTask id="retrieveInformation" name="Get Info" scriptFormat="groovy" activiti:autoStoreVariables="false">
      <script><![CDATA[
execution.setVariable('account','My Account');
execution.setVariable('limit','3000');
execution.setVariable('performer','Michael Jackson');]]></script>
    </scriptTask>


But the form displaying the values shows '(empty)'. I've even tried creating task variables at a task listener script on the user task with no luck


<activiti:taskListener event="create" class="org.activiti.engine.impl.bpmn.listener.ScriptTaskListener">
          <activiti:field name="script">
            <activiti:string><![CDATA[
task.setVariable('account',"My Activiti account");
limit="15000";
performer="Someone";]]></activiti:string>
          </activiti:field>
          <activiti:field name="language">
            <activiti:string>javascript</activiti:string>
          </activiti:field>
        </activiti:taskListener>


Any ideas? I know this is a Beta version, just wondering if this should be working.

Outcomes