"XOR split could not find at least one valid outgoing connection for split Gateway" ERROR is thrown when trying to complete a process in jBPM5/6

Solution Unverified - Updated -

Environment

  • Red Hat JBoss BRMS (BRMS)
    • 5.3.0
  • Red Hat JBoss BPM Suite (BPMS)
    • 6

Issue

  • In jBPM 5 for a process branch involving an XOR gateway, when users call the complete(...) task function after the Human Task is reached in the flow, sometimes the below error is returned.

    ...
    10:27:48,933 ERROR [HornetQTaskClientConnector] Client Exception with class class org.jbpm.task.service.hornetq.HornetQTaskClientConnector$1 using port 5153
    java.lang.IllegalArgumentException: XOR split could not find at least one valid outgoing connection for split Gateway
    ...
    
  • It is found that if users edit the process and enter the XOR constraints again it will work and the error will not be displayed again. The below code is called to complete the task:

    ...
    TaskClient client = null;
    try {
    
            client = getHumanTaskClient();
            BlockingTaskOperationResponseHandler handler = new BlockingTaskOperationResponseHandler();
            ContentData contentData = new ContentData();
            ByteArrayOutputStream boStream = new ByteArrayOutputStream();
                            ObjectOutputStream outStream = new ObjectOutputStream(boStream);
                            Map output = new HashMap();
                            ...
                            output.put("outcome", outcome);
                            outStream.writeObject(output);
                            outStream.close();
                            contentData.setContent(boStream.toByteArray());
                            contentData.setAccessType(AccessType.Inline);
            ...
            client.start(Long.valueOf(taskId), user, handler);
            logger.debug("start .. ");
            client.complete(Long.valueOf(taskId), user, contentData, handler);
            ...
            handler.waitTillDone(100);            --- > This is where error occurs 
            ...                    
    
  • What could be the root cause of this issue?

Resolution

Review the XOR gateway conditions to verify if they are set properly to provide at least one valid outgoing connection for the process. Some of the known mistakes users do is evaluating drools expressions (which are set at the gateways) based on process variables. Drools expressions work with facts not process variables. Hence, try to insert those process variables first into working-memory as facts before the XOR gateway is reached so that the gateway validation runs properly.

Root Cause

  • There could be many reasons for this issue depending on the usage of XOR Gateway:

    • XOR gateway conditions might not have been set properly to provide at least one valid outgoing connection for the process.
    • Evaluating drools expressions (which are set at the gateways) based on process variables. Whereas, Drools expressions work with facts not process variables.

Diagnostic Steps

  • Check the process flow;
  • Check the conditions at XOR Gateway.

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments