Give input from java dynamically

<multiInstanceLoopCharacteristics isSequential="false|true">
  <loopCardinality>${nrOfOrders-nrOfCancellations}</loopCardinality>
</multiInstanceLoopCharacteristics>

How can i give this loopcardinality input from java …so that i can run subprocesses dynamically as per my need from java

In your delegate code you can run

execution.setVariable("nrOfOrders-nrOfCancellations", 5);