Camunda 7 service task integration with external REST api

Hello All, I am fairly new to camunda paradigm and still learning. I am trying to deploy a BPMN in the camunda running locally but I have stumbled across an error which I am not able to get through. Error - "ENGINE-09005 Could not parse BPMN process. Errors:

  • Either loopCardinality or loopDataInputRef/activiti:collection must been set | resource Planning_Process.bpmn | line 26 | column 48 [ deploy-error ]".
    Would appreciate if any one can give me any leads on this.

Hello @aviorn36 ,

welcome to the forum.

You are using a parallel multi instance on a service task, meaning the service task should be executed multiple times (potentially in parallel).

For the engine to know what context is used to create the multi instance, you should enter the information in the properties panel:

If you have a list of elements to loop, enter the process variable name to Collection. If you then use Element variable, the element that is currently handled will be available with the given variable name.

If you want to loop for an amount of times, you can use the Loop cardinality and enter 3 for example. If you want this to stop at some point, you can set a completion condition which in an expression that needs to be evaluated to a boolean value, in the easiest case a process variable (for example ${iAmDoneNow}).

I hope this helps

Jonathan

1 Like

Hello @jonathan.lukas , thank you for your prompt suggestion. I am not aware if I have used parallel multi-instance on service task. My use-case was simply calling a rest api which returns json with one attribute, parsing that json in service task with groovy script and populating a variable to be used in further task in the process. Could you please shed some light on this ā€œmulti-instance service taskā€ and the type of service task I can opt for my simple use-case?
Thank-you one again :slight_smile:

Hello @aviorn36 ,

the marker with the 3 vertical stripes on the bottom of the element indicate a parallel multi instance. If this does not fit your use case, you can remove it in the context panel of the modeler (click on the wrench and disable it).

Jonathan

1 Like

Hello @jonathan.lukas , thank you. That fixed it.
But now I have started to get another issue, for some reason in a user task with ā€œGenerated Task formā€ with one form fields as ā€œinputā€. When I start a process and enter a number, I get this error - " An error happened while submitting the task form** : FEEL/SCALA-01008 Error while evaluating expression: failed to evaluate expression ā€˜inputā€™: no variable found for name ā€˜inputā€™" in camunda taskList interface.
I have read the documentation and checked many online available artifacts it looks like I am doing everything right.
Would appreciate if you could help me out this one too. :slight_smile:

Hello @aviorn36 ,

I am glad this worked. Could you please share the bpmn file that you try to execute?

This will help us to find the possible cause for this issue.

Jonathan

1 Like

Hello @jonathan.lukas ,
I have attached bpmn consisting of a workflow which has a business rule task tagged to nature_table.dmn. For some reason the first user task is unable to create a process variable(number) which would act as a input for DMN/Rule task in the 2nd step.

Error:-
An error happened while submitting the task form : FEEL/SCALA-01008 Error while evaluating expression: failed to evaluate expression ā€˜0ā€™: no variable found for name ā€˜numberā€™

Have tried most of the ways I could possibly find and still couldnā€™t get through. Could you please help me find out what mistake I am doing? :slight_smile:
nature_process.bpmn (4.1 KB)
nature_table.dmn (2.1 KB)

1 Like

Hello @aviorn36 ,

thank you for coming back. It seems you found a bug.

I could recreate your problem and created a JIRA ticket:

https://jira.camunda.com/browse/CAM-14816

There is a problem with rendering of the generated task form which should not be the case. You are doing everything correct! For further testing, you could use Forms of type which will be a generic form (you can add and modify variables as you like) or you could use a camunda form:

Here is the example you provided with a Camunda Form:

nature_form.form (361 Bytes)
nature_process.bpmn (4.0 KB)
nature_table.dmn (2.0 KB)

I hope this helps

Jonathan

1 Like

Thanks once again @jonathan.lukas , I will try to get details and implement on the workaround you have suggested.

Hello @aviorn36 ,

thank you for your effort. Anyway, I would recommend Camunda Forms over generated forms.

Both can be done with the Modeler, but form-js is WHSIWYG plus it already has more features than generated forms.

Also, form-js is also part of platform 8 and will be continuesly improved.

Jonathan

Hello @aviorn36 ,

the bug you found should be fixed in Modeler 5.2.0 according to

I will try this on monday.

Jonathan