cancel
Showing results for 
Search instead for 
Did you mean: 

Can Activiti handle Complex Gateway?

al_lv
Champ in-the-making
Champ in-the-making
Hi all,

can Activiti handle complex gateways and how they schould be define?
I found no complex Gateway in Activiti Designer so I modeled my process with Activiti-Modeler and copied the necessary part into the process definition.

An error I get by the process deployment is:
11.03.2011 14:12:41 org.apache.axis2.receivers.AbstractMessageReceiver error
ERROR: org.apache.axis2.AxisFault: Invalid destination 'complexgateway2' of sequence flow 'flow9' | diagrams/siebel_test_diagram.bpmn20.xml | line 18 | column 91
Invalid destination 'complexgateway2' of sequence flow 'flow15' | diagrams/siebel_test_diagram.bpmn20.xml | line 19 | column 92
Invalid source 'complexgateway2' of sequence flow 'flow11' | diagrams/siebel_test_diagram.bpmn20.xml | line 20 | column 92

process model:
[attachment=0]archive_and_email_v2.png[/attachment]

process definition:

<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/test">
  <process id="siebel" name="siebel">
    <startEvent id="startevent1" name="Start"></startEvent>
    <serviceTask id="servicetask1" name="SiebelTask" activiti:class="de.ec4u.c4.workflowserver.servicetasks.SiebelTask"></serviceTask>
    <parallelGateway id="parallelgateway1" name="Parallel Gateway"></parallelGateway>
    <sequenceFlow id="flow1" name="" sourceRef="startevent1" targetRef="parallelgateway1"></sequenceFlow>
    <sequenceFlow id="flow2" name="" sourceRef="parallelgateway1" targetRef="servicetask1"></sequenceFlow>
    <serviceTask id="servicetask2" name="EmailTask" activiti:class="de.ec4u.c4.workflowserver.servicetasks.EmailTask"></serviceTask>
    <sequenceFlow id="flow3" name="" sourceRef="parallelgateway1" targetRef="servicetask2"></sequenceFlow>
    <parallelGateway id="parallelgateway2" name="Parallel Gateway"></parallelGateway>
    <sequenceFlow id="flow13" name="" sourceRef="servicetask1" targetRef="parallelgateway2"></sequenceFlow>
    <sequenceFlow id="flow5" name="" sourceRef="servicetask2" targetRef="parallelgateway2"></sequenceFlow>
    <endEvent id="endevent1" name="End"></endEvent>
    <sequenceFlow id="flow6" name="" sourceRef="parallelgateway2" targetRef="endevent1"></sequenceFlow>
    <serviceTask id="servicetask3" name="WriteToFile" activiti:class="de.ec4u.c4.workflowserver.servicetasks.WriteToFile"></serviceTask>
    <complexGateway id="complexgateway2" name="complex Gateway"></complexGateway>
    <sequenceFlow id="flow9" name="" sourceRef="servicetask2" targetRef="complexgateway2"></sequenceFlow>
    <sequenceFlow id="flow15" name="" sourceRef="servicetask1" targetRef="complexgateway2"></sequenceFlow>
    <sequenceFlow id="flow11" name="" sourceRef="complexgateway2" targetRef="servicetask3"></sequenceFlow>
    <endEvent id="endevent2" name="End"></endEvent>
    <sequenceFlow id="flow12" name="" sourceRef="servicetask3" targetRef="endevent2"></sequenceFlow>
  </process>
</definitions>


Alexej
4 REPLIES 4

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
Hi all,

can Activiti handle complex gateways and how they schould be define?

Sorry, no, it would have been in the docs if it was supported. It might be a good idea though to give explicit errors about this and not fail on the sequenceflow.

jbarrez
Star Contributor
Star Contributor
Normally the parser should log a warning that you are using an unsupported element.

al_lv
Champ in-the-making
Champ in-the-making
the question is:
if the complex gateway isn't supported, which gateway should I use then in this case?

The scenario is:
The WriteToFile Task should start as soon as the one of both other Service Tasks throw exception. Can XOR Gateway solve a problem?

Thanks

Alexej

jbarrez
Star Contributor
Star Contributor
You can just catch the exception in your Java delegation class and select the transition yourself.