AnsweredAssumed Answered

how to set a variable in startevent?

Question asked by miraclesuki on Jun 15, 2015
Latest reply on Jun 16, 2015 by jbarrez
I want to get the property value "mcwf:status" from the model in startevent. Then I need to pass the value of "mcwf:status" to other forms.

Below is the code, it does not printout the variable, it seems that the part of extensionElemnts has not been run?

The snippet of the bpmn diagram:
<startEvent id="startevent1" name="Start" activiti:formKey="mcwf:submitReviewTask">
        <activiti:taskListener event="complete" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
          <activiti:field name="script">
                        var newstatus = task.getVariableLocal('mcwf_status');
                        execution.setVariable('mcwf_newstatus', newstatus);
                        logger.log("AAAAAAAAA      " + newstatus);
The snippet of the model file:
<aspect name="mcwf:status">
                <property name="mcwf:status">
                        <constraint type="LIST">
                          <parameter name="allowedValues">
If I change the startevent to usertask, then I copy the code of extensionElements and paste instead of it, and don't know why it can be work properly.