I am using xCP Designer 2.0 and I'm trying to create multiple objects at once. Say I receive the number 20 as input and need to create 20 of these objects with an increasing integer attribute from 1-20.
Is it possible to achieve this with a stateless process? How exactly?
You have at least 2 options:
If you decide for first, you can check how to integrate your custom (Java) code to the xCPDesigner via self paced tutorial which you can download from this link. You find useful things on this link too.
If you choose second approach, do it this way:
Add process variable like here
Model a stateless process like on the picture
Define loop_count++ activity like on the picture
Note that loop_count++ activity is of type Set Process Data. Additionally, you need to set trigger tab on Join activity like in a picture:
You will know what to do in Create activity. ;)
EDIT: I just saw I overlooked you stated that you set 20 when initiating stateless process. Logic is the same, you just use Substract function in loop_count++ activity (you can consider changing activity name too) :)