AnsweredAssumed Answered

Javascript Scripttask help

Question asked by arschloch1989 on Nov 23, 2011
Latest reply on Aug 25, 2013 by rockstrom
Hi,

I've created a script task in a subprocess, but value is null after i declare it, how to I declare a value in the script that can be used in a exclusive gateway so that I can proceed through my workflow.

when i run the process and get to this part(script task) I get an error saying no outgoing sequence flow of… when i try to complete task of choosing my phone model.

Any help would be greatly appreciated

snippet of the code:

<userTask id="selectSonyEricssonModel" name="Select Sony Ericsson Model" activiti:candidateGroups="Employee">
        <documentation>Please select the Sony Ericsson Model you would like from the list below.</documentation>
        <extensionElements>
        <activiti:formProperty id="sonyEricssonModel" name="Sony Ericsson Model:" type="enum" required="true">
          <activiti:value id="sonyEriccsonModel1" name="Sony Ericsson X10"></activiti:value>
          <activiti:value id="sonyEriccsonModel2" name="Sony Ericsson X10 Mini Pro"></activiti:value>
          <activiti:value id="sonyEriccsonModel3" name="Sony Ericsson X8"></activiti:value>
          <activiti:value id="sonyEriccsonModel4" name="Sony Ericsson Arc"></activiti:value>
          <activiti:value id="sonyEriccsonModel5" name="Sony Ericsson Neo"></activiti:value>
        </activiti:formProperty>
        </extensionElements>
      </userTask>
     
      <sequenceFlow id="flow8" name="" sourceRef="selectSonyEricssonModel" targetRef="phonePrice"></sequenceFlow>

<scriptTask id="phonePrice" name="Phone Price" scriptFormat="javascript" activiti:resultVariable="myVar">
        <script>
        <![CDATA[
             var myVar = 250;   
           ]]>
      </script>
      </scriptTask>
       
      <sequenceFlow id="flow9" name="" sourceRef="phonePrice" targetRef="endSelectPhoneProcess"></sequenceFlow>
     
      <endEvent id="endSelectPhoneProcess" name="End Select Phone Process"></endEvent>
        
    </subProcess>
    
    <sequenceFlow id="flow13" name="" sourceRef="selectPhoneProcess" targetRef="approveRequestDecision"></sequenceFlow>
   
    <exclusiveGateway id="approveRequestDecision" name="Approve Request Decision"></exclusiveGateway>
      
    <sequenceFlow id="flow14" name="Request Rejected" sourceRef="approveRequestDecision" targetRef="selectPhoneProcess">
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${myVar > 350 }]]></conditionExpression>
    </sequenceFlow>
      
    <sequenceFlow id="flow15" name="Request Approved" sourceRef="approveRequestDecision" targetRef="viewRequest">
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${myVar <= 350}]]></conditionExpression>
    </sequenceFlow>
   
   
    <userTask id="viewRequest" name="View Request" activiti:candidateGroups="Managers">
    <documentation textFormat="text/plain">${myVar}</documentation>
    </userTask>

Outcomes