ServiceTask is not working


#1

Hi,
I am trying to setup the servicetask but i am unable to deploy due to BPMN parse issue.

i am getting below error.

One of the attributes ‘class’, ‘delegateExpression’, ‘type’, or ‘expression’ is mandatory on serviceTask. | loanApprovalService.bpmn. and i am using connector and http-connector.


#2

what are you trying to achieve and what have you done so far?
Uploading your model will help as well.


#3

You need to configure implementation for service task to perform some task.

Configure service task like this:

Your Java class implementation should look like below:

package com.example;

public class HelloWorld implements JavaDelegate {

	public void execute(DelegateExecution execution) throws Exception {
      //Your code
    }
}

Refer the docs: https://docs.camunda.org/manual/7.10/reference/bpmn20/tasks/service-task/


#4

i want to use connector


#5

Refer this blog for http connector usage.

BPMN File: connector.bpmn (23.7 KB)

Check this too:


#6

Why do you want to use connectors?
They have a few draw backs, you should first consider external tasks, in care they’re more applicable.


#7

okay. Could you please let me know those drawbacks? We are creating custom connectors as we want to use Eureka to identify the app based on app name for zone affinity.

Do you have a better example to know more about the external task to be used for service invocations? Could you please provide me the same.


#8

I can give you an idea of the downsides:
The config for connectors are embedded in the XML model which makes them harder to test. It also means that due to how versioning works in the engine any change in your connetor would change the version of the modeler.

External Tasks work on a publish subscribe methodology, meaning it’s much easier to maintain independent development cycles for the process and service. It also let you use any programing language of your choice in stead of having to use compatible scripts.


#9

Hi @Shaffic_Jan,

I totally agree with the drawbacks of the connectors.

To use it you have to configure the camunda-connect library: https://docs.camunda.org/manual/7.10/user-guide/process-engine/connectors/#configure-camunda-connect

This should solve your parsing issue.

Hope this helps, Ingo