AnsweredAssumed Answered

How to get selected list values through script in workflow

Question asked by lsharmaa on Jul 4, 2011
Latest reply on Jul 28, 2011 by lsharmaa
Hi All,

Im working with alfresco 3.4 and my requirement is like i need to include a property(comment Type) with dropdown list in workflow-options page where you can view the Description,due date,priority,comment etc.

My contentworkflow-model file is:


<property name="finalkaplan:commentType">
<type>d:text</type>
   <constraints>
         <constraint ref="finalkaplan:commentTypeList" />
   </constraints>
   </property>
<constraint name="finalkaplan:commentTypeList" type="LIST">
         <parameter name="allowedValues">
            <list>
               <value>copyEditError</value>
               <value>subjectError</value>
               <value>GeneralError</value>
               <value>UnknownError</value>
            </list>
         </parameter>
      </constraint>


My web-cilent-config file is :

<config evaluator="node-type" condition="finalkaplan:reviewTask"
      replace="true">
      <property-sheet>
         <show-property name="bpm:workflowDescription"
            display-label="Description" />
         <show-property name="bpm:workflowDueDate"
            display-label="Due Date" />
         <show-property name="bpm:workflowPriority"
            display-label="Priority" />
            <show-property name="finalkaplan:commentType" display-label="CommentType"/>
         <show-property name="bpm:comment" display-label="Comments" />

My script in process definition is:

<script>
  var temp=bpm_package.children[0].properties["finalkaplan:commentTypeList"];
   taskInstance.setVariable("finalkaplan_commentTypeList",temp);
   doc=companyhome.childByNamePath("Kaplan/Admin/comment");
   var outFile=doc.createFile("comment.txt");
   outFile.content=temp;
   outFile.save();
  </script>

The Exception Im getting is cannot call setvariable() Method of null.so anyone can help me like how to get selected list value in workflow???
or
say lik if i use bpm_package.children[0].properties["finalkaplan:commentTypeList"] means its getting only the first value of the drop down and doesn't returns the selected value. So can anyone help, in the above statement how to get selected value??

Its urgent can anyone help me??
Thanks,
sharma.

Outcomes