AnsweredAssumed Answered

Deploy failed with message 'found some invalid starting element 'serviceTask''

Question asked by stalwartwill on Dec 3, 2015
Latest reply on Dec 4, 2015 by martin.grofcik
<?xml version="1.0" encoding="UTF-8"?>
<definitions id="definitions" name="Service task demo process definitions"
  targetNamespace="http://activiti.org/bpmn20"
  xmlns:activiti="http://activiti.org/bpmn"
  xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"> 
         
     <process id="compensateSubprocessProcess" name="Compensate sub process">             
        <documentation>
            Compensation Boundary Event Demo
        </documentation>
        <startEvent id="processStart"/>
        <sequenceFlow sourceRef="processStart" targetRef="parallelFork"/>
        
        <parallelGateway id="parallelFork"/>
        <sequenceFlow sourceRef="parallelFork" targetRef="bookHotelSubprocess"/>
        <sequenceFlow sourceRef="parallelFork" targetRef="chargeCreditCard"/>
        
        <subProcess id="bookHotelSubprocess" name="Book hotel supprocess">
           <startEvent id="subprocessStart"/>
           <sequenceFlow sourceRef="subprocessStart" targetRef="chooseHotel"/>
           
           <userTask id="chooseHotel" name="Choose a hotel to book" activiti:assignee="${initiator}">
              <documentation>
                 Search and compare hotels on network, and choose a hotel to book.
              </documentation>
              <extensionElements>
                 <activiti:formProperty id="hotelName" type="string" value="${hotelName}" required="true"/>
              </extensionElements>
           </userTask>

           <sequenceFlow sourceRef="chooseHotel" targetRef="bookHotel"/>
           
           <serviceTask id="bookHotel" name="Book hotel"
                 activiti:class="org.activiti.demo.book.event.compensation.BookHotelService">
              <documentation>
                 book hotel service task.
              </documentation>
           </serviceTask>
           <sequenceFlow sourceRef="bookHotel" targetRef="reviewBookings"/>

         <boundaryEvent id="compensateBookHotelEvent" attachedToRef="bookHotel">
            <compensateEventDefinition/>
         </boundaryEvent>
         <association id="a1" sourceRef="compensateBookHotelEvent"
               targetRef="cancelHotelReservation" associationDirection="None"/>                    
           
           <serviceTask id="cancelHotelReservation" name="Cancel hotel reservation" isForCompensation="true"
                 activiti:class="org.activiti.demo.book.event.compensation.CancelHotelReservation">
              <documentation>
                 cancel hotel reservation in compensation
              </documentation>
           </serviceTask>
           
           <userTask id="reviewBookings" name="Review bookings" activiti:assignee="${initiator}">
              <extensionElements>
                 <activiti:formProperty id="reviewResult" type="boolean" value="${reviewResult}" required="true"/>
              </extensionElements>
           </userTask>
           <sequenceFlow sourceRef="reviewBookings" targetRef="subprocessEnd"/>
           
           <endEvent id="subprocessEnd"/>
        </subProcess>
        <sequenceFlow sourceRef="bookHotelSubprocess" targetRef="processEnd1"/>
                
        <userTask id="chargeCreditCard" name="Charge credit card">
           <extensionElements>
              <activiti:formProperty id="chargeResult" type="boolean" value="${chargeResult}" required="true">
                 <activiti:value id="success"/>
                 <activiti:value id="fail"/>
              </activiti:formProperty>
           </extensionElements>
        </userTask>
        <sequenceFlow sourceRef="chargeCreditCard" targetRef="processEnd2">
           <conditionExpression>${chargeResult == 'success'}</conditionExpression>
        </sequenceFlow>
        <sequenceFlow sourceRef="chargeCreditCard" targetRef="throwCompensation">
           <conditionExpression>${chargeResult == 'fail'}</conditionExpression>
        </sequenceFlow>
        
        <intermediateThrowEvent id="throwCompensation" name="Cancel reservation by throw compensation">
           <compensateEventDefinition activityRef="bookHotelSubprocess"/>
        </intermediateThrowEvent>
        <sequenceFlow sourceRef="throwCompensation" targetRef="processEnd3"/>
        
        <endEvent id="processEnd1"/>
        <endEvent id="processEnd2"/>
        <endEvent id="processEnd3"/>
     </process>
 
</definitions> 

Outcomes