cancel
Showing results for 
Search instead for 
Did you mean: 

exclusive gateway has no visible effect

werners
Champ in-the-making
Champ in-the-making
Hi all,
i would like to use a exclusive gateway that has three cases, yes, no and “doku”.
If the user chose yes am user task should be in invoked. In the cases of “No” and “Doku” two different messages should be send with email.
When i start an instance of my process definition, I can choose the value for exclusive gateway via dropdown, but I always receive only these mails from the service task “informCustomer”.
process definition:

<userTask id="evaluateRequestByManager" name="Evaluate loan request by manager" activiti:candidateGroups="management">
      <extensionElements>
        <activiti:formProperty id="customerName" name="Customer name" expression="${loanApplication.customerName}" writable="false"/>
        <activiti:formProperty id="income" name="Income of customer" expression="${loanApplication.income}" writable="false"/>
        <activiti:formProperty id="requestedAmount" name="Requested loan amount" expression="${loanApplication.requestedAmount}" writable="false"/>
        <activiti:formProperty id="creditCheckOk" name="Outcome of credit check" expression="${loanApplication.creditCheckOk}" writable="false"/>
        <activiti:formProperty id="requestApproved" name="Do you approve the request?" required="true" type="enum">
          <activiti:value id="true" name="Yes"/>
          <activiti:value id="false" name="No"/>
          <activiti:value id="doku" name="Doku"/>
        </activiti:formProperty>
        <activiti:formProperty id="explanation" name="Explanation"/>
      </extensionElements>
    </userTask>
    <sequenceFlow sourceRef="evaluateRequestByManager" targetRef="approvalGateway" />
    <exclusiveGateway id="approvalGateway" />
    <sequenceFlow sourceRef="approvalGateway" targetRef="informCustomer">
      <conditionExpression xsi:type="tFormalExpression">${requestApproved == false}</conditionExpression>
    </sequenceFlow>
    <sequenceFlow sourceRef="approvalGateway" targetRef="processRequest">
        <conditionExpression xsi:type="tFormalExpression">${requestApproved == true}</conditionExpression>
    </sequenceFlow>
     <sequenceFlow sourceRef="approvalGateway" targetRef="moredocuments">
        <conditionExpression xsi:type="tFormalExpression">${requestApproved == doku}</conditionExpression>
    </sequenceFlow>
    <serviceTask id="informCustomer" activiti:type="mail">
      <extensionElements>
        <activiti:field name="to" expression="${loanApplication.emailAddress}" />
        <activiti:field name="subject" stringValue="Loan Request Denied" />
        <activiti:field name="html">
          <activiti:expression>
            <![CDATA[
              <html>
                <body>
                  Hello ${loanApplication.customerName},<br/><br/>
                 
                  Your loan request has been denied for the following reason:${explanation}.<br/><br/>
                 
                  Kind regards,<br/>
                 
                  The Loan Sharks Company.
                </body>
              </html>
            ]]>
          </activiti:expression>
        </activiti:field>
      </extensionElements>
    </serviceTask>
     <sequenceFlow sourceRef="informCustomer" targetRef="theEnd" />
     <serviceTask id="moredocuments" activiti:type="mail">
      <extensionElements>
        <activiti:field name="to" expression="${loanApplication.emailAddress}" />
        <activiti:field name="subject" stringValue="Request for more documents" />
        <activiti:field name="html">
          <activiti:expression>
            <![CDATA[
              <html>
                <body>
                  Hello ${loanApplication.customerName},<br/><br/>
                 
                  We need mor documents: ${explanation}.<br/><br/>
                 
                  Kind regards,<br/>
                 
                  The Loan Sharks Company.
                </body>
              </html>
            ]]>
          </activiti:expression>
        </activiti:field>     
      </extensionElements>
    </serviceTask>
  
    <sequenceFlow sourceRef="moredocuments" targetRef="theEnd" />
    <userTask id="processRequest" name="Process the loan request" activiti:assignee="fozzie" />
    <sequenceFlow sourceRef="processRequest" targetRef="theEnd" />
   
    <endEvent id="theEnd" />
  </process>
</definitions>

Can someone give me an advice what is wrong with my processdefinition?
Thank you in advance.


2 REPLIES 2

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi Werner,

I have found similar process definition (form -> exclusive gateway) in user guide
http://www.activiti.org/userguide/#api.services


    <sequenceFlow id="flow5" sourceRef="requestApprovedDecision" targetRef="adjustVacationRequestTask">
      <conditionExpression xsi:type="tFormalExpression">${vacationApproved == 'false'}</conditionExpression>
    </sequenceFlow>

I think there is difference in ''

Regards
Martin

werners
Champ in-the-making
Champ in-the-making
Hi Martin,

thank you. You were right. It runs now.

Regards
Werner