Looping the bulk entities

I have a bulk entities as a Json like below


And based on above Json tasks need to be run Parallelly like looping concept till entities size. Once complete the loop only further task and end event need to trigger.

In ChatGPT suggestion the below approch. But I have a validation error.

Certainly! Based on the JSON data you provided, here’s an example of a Flowable BPMN process that uses an inclusive gateway and multiInstanceLoopCharacteristics to process the given data in parallel based on the “Type” field:

<!-- Inclusive Gateway for Parallel Paths -->
<inclusiveGateway id="inclusiveGateway" name="Inclusive Gateway" />

<!-- User Tasks for Different Types -->
<userTask id="hrTask" name="HR Task" />
<userTask id="feTask" name="FE Task" />
<userTask id="beTask" name="BE Task" />
<userTask id="baTask" name="BA Task" />

<!-- End Event -->
<endEvent id="endEvent" />

<!-- Sequence Flows -->
<sequenceFlow id="flowStartToInclusiveGateway" sourceRef="startEvent" targetRef="inclusiveGateway" />
<sequenceFlow id="flowInclusiveGatewayToHRTask" sourceRef="inclusiveGateway" targetRef="hrTask">
    <conditionExpression xsi:type="tFormalExpression">${item.Type == 'HR'}</conditionExpression>
<sequenceFlow id="flowInclusiveGatewayToFETask" sourceRef="inclusiveGateway" targetRef="feTask">
    <conditionExpression xsi:type="tFormalExpression">${item.Type == 'FE'}</conditionExpression>
<sequenceFlow id="flowInclusiveGatewayToBETask" sourceRef="inclusiveGateway" targetRef="beTask">
    <conditionExpression xsi:type="tFormalExpression">${item.Type == 'BE'}</conditionExpression>
<sequenceFlow id="flowInclusiveGatewayToBATask" sourceRef="inclusiveGateway" targetRef="baTask">
    <conditionExpression xsi:type="tFormalExpression">${item.Type == 'BA'}</conditionExpression>
<sequenceFlow id="flowHRTaskToEnd" sourceRef="hrTask" targetRef="endEvent" />
<sequenceFlow id="flowFETaskToEnd" sourceRef="feTask" targetRef="endEvent" />
<sequenceFlow id="flowBETaskToEnd" sourceRef="beTask" targetRef="endEvent" />
<sequenceFlow id="flowBATaskToEnd" sourceRef="baTask" targetRef="endEvent" />

<!-- Multi-Instance Loop Definition for Parallel Execution -->
<multiInstanceLoopCharacteristics id="multiInstanceLoopCharacteristics" isSequential="false">
    <loopCardinality>4</loopCardinality> <!-- Number of parallel instances -->
    <loopDataInputRef>itemList</loopDataInputRef> <!-- Assuming itemList is a collection variable -->

<!-- Process Variables -->
<dataObjectReference id="itemListRef" dataObjectRef="itemList" />

In this example:

The inclusive gateway inclusiveGateway is used to create different parallel paths based on the “Type” field from the JSON data.
The conditions in the sequence flows leading from the inclusive gateway determine the path taken based on the “Type” field.
Four different user tasks (hrTask, feTask, beTask, and baTask) represent different behaviors based on the “Type” field.
The multiInstanceLoopCharacteristics is used to process each item in the JSON data array in parallel.
The end event endEvent indicates the completion of the process.
Before starting the process instance, make sure to set the value of the itemList variable with the provided JSON data.

Please adjust the task names, conditions, variables, and other process elements according to your specific use case. This example demonstrates how to use an inclusive gateway with different behaviors based on conditions, combined with the multiInstanceLoopCharacteristics for parallel execution, in Flowable BPMN.

Validation Error :
cvc-complex-type.2.4.a: Invalid content was found starting with element ‘{“http://www.omg.org/spec/BPMN/20100524/MODEL”:multiInstanceLoopCharacteristics}’. One of ‘{“http://www.omg.org/spec/BPMN/20100524/MODEL”:flowElement, “http://www.omg.org/spec/BPMN/20100524/MODEL”:artifact, “http://www.omg.org/spec/BPMN/20100524/MODEL”:resourceRole, “http://www.omg.org/spec/BPMN/20100524/MODEL”:correlationSubscription, “http://www.omg.org/spec/BPMN/20100524/MODEL”:supports}’ is expected.

How to resolve this error ? Is there any other way for achive my requirement in flowable 6.7.4

Hi @filiphr - Any idea about my request.