SendTask in bpmn gives parsing error while deployment

In my model i have a send task like below and configured connector to send email. But i was getting below parsing errors while deploying through rest api. Any clues why its not considering connectors?

  <bpmn:sendTask id="RejectionNotificationTask" name="Rejection Notification">
          <bpmn:extensionElements>
            <camunda:connector>
              <camunda:inputOutput>
                <camunda:inputParameter name="to">aravindh@gmail.com</camunda:inputParameter>
                <camunda:inputParameter name="subject">Rejection Notification</camunda:inputParameter>
                <camunda:inputParameter name="text">Rejection  Notification</camunda:inputParameter>
              </camunda:inputOutput>
              <camunda:connectorId>mail-send</camunda:connectorId>
            </camunda:connector>
          </bpmn:extensionElements>
          <bpmn:incoming>RejectedSequenceFlow</bpmn:incoming>
          <bpmn:outgoing>SequenceFlow_1hm7x04</bpmn:outgoing>
   </bpmn:sendTask>

[ExceptionHandler]e[0;39m e[31m[toResponse]e[0;39m @ 54 : e[32morg.camunda.bpm.engine.ProcessEngineException: ENGINE-09005 Could not parse BPMN process. Errors:

  • One of the attributes ‘class’, ‘delegateExpression’, ‘type’, or ‘expression’ is mandatory on sendTask. | test.bpmn | line 37 | column 133
  • One of the attributes ‘class’, ‘delegateExpression’, ‘type’, or ‘expression’ is mandatory on sendTask. | test.bpmn | line 72 | column 94
  • One of the attributes ‘class’, ‘delegateExpression’, ‘type’, or ‘expression’ is mandatory on sendTask. | test.bpmn | line 94 | column 92
    at org.camunda.bpm.engine.impl.util.EngineUtilLogger.exceptionDuringParsing(EngineUtilLogger.java:62)
    at org.camunda.bpm.engine.impl.util.xml.Parse.throwExceptionForErrors(Parse.java:208)
    at org.camunda.bpm.engine.impl.bpmn.parser.BpmnParse.execute(BpmnParse.java:272)

Generally speaking i think it’s best to avoid connectors, but if you can upload your model i can take a look. :slight_smile:

@Niall Connectors are not supported in SendTask? i have found the below example from github using conncetors in SendTask activity.

BPMN Model : orderprocess.bpmn (7.3 KB)

Exception stacktrace:

e[1;31m[org.camunda.bpm.engine.context]e[0;39m e[31m[logError]e[0;39m @ 160 : e[32mENGINE-16004 Exception while closing command context: ENGINE-09005 Could not parse BPMN process. Errors:

  • One of the attributes ‘class’, ‘delegateExpression’, ‘type’, or ‘expression’ is mandatory on sendTask. | orderprocess.bpmn | line 8 | column 82
  • One of the attributes ‘class’, ‘delegateExpression’, ‘type’, or ‘expression’ is mandatory on sendTask. | orderprocess.bpmn | line 35 | column 81e[0;39m
    org.camunda.bpm.engine.ProcessEngineException: ENGINE-09005 Could not parse BPMN process. Errors:
  • One of the attributes ‘class’, ‘delegateExpression’, ‘type’, or ‘expression’ is mandatory on sendTask. | orderprocess.bpmn | line 8 | column 82
  • One of the attributes ‘class’, ‘delegateExpression’, ‘type’, or ‘expression’ is mandatory on sendTask. | orderprocess.bpmn | line 35 | column 81
    at org.camunda.bpm.engine.impl.util.EngineUtilLogger.exceptionDuringParsing(EngineUtilLogger.java:62)
    at org.camunda.bpm.engine.impl.util.xml.Parse.throwExceptionForErrors(Parse.java:208)
    at org.camunda.bpm.engine.impl.bpmn.parser.BpmnParse.execute(BpmnParse.java:272)

When i debug, i got null for all the below variables.

String type = serviceTaskElement.attributeNS(CAMUNDA_BPMN_EXTENSIONS_NS, TYPE);
String className = serviceTaskElement.attributeNS(CAMUNDA_BPMN_EXTENSIONS_NS, PROPERTYNAME_CLASS);
String expression = serviceTaskElement.attributeNS(CAMUNDA_BPMN_EXTENSIONS_NS, PROPERTYNAME_EXPRESSION);
String delegateExpression = serviceTaskElement.attributeNS(CAMUNDA_BPMN_EXTENSIONS_NS, PROPERTYNAME_DELEGATE_EXPRESSION);
String resultVariableName = parseResultVariable(serviceTaskElement);

Exception thrown at the point due to if(activity.getActivityBehavior() == null) block, because type==null, so activity behaviour was null:

I guess they’re no supported - maybe another good reason not to use connectors then (or just switch it to a service task)

Okay. Thanks for the update.

If i can’t use connectors in SendTask, in which activity the connector component was supported?

Also, note that camunda modeler allows to configure Connectors in SendTask.

I think you mean that it allows for connectors for SendTasks and ServiceTasks. Receive tasks have no implementations requirements.

So, i gave it a try and didn’t have any problems using a connector with a SendTask - i was able to deploy and run it without any issues. so maybe that isn’t the problem you’re having.
What version of the engine are you using?

Small correction. RecieveTask doesn’t require any implementations. But it allows for connectors for SendTasks.

camunda 7.11/ springboot setup.

And i have added below dependencies for connectors:

compile group: 'org.camunda.bpm.extension', name: 'camunda-bpm-mail-core', version: '1.2.0'
compile group: 'org.camunda.connect', name: 'camunda-connect-core', version: '1.2.2'
compile group: 'com.sun.mail', name: 'javax.mail', version: '1.6.2'

Also let me know any dependencies am i missing. The bpmn which i gave it worked fine in your machine?

The one you uploaded deployed correctly - but i built my own just to test that connectors in general work on send tasks.
The problem could be the mail plugin

Problem in mail plugin means, it should throw the exception during the execution of the SendTask activity. But I got the exception while deploying the process itself.

Hi @aravindhrs,

I guess you need the connector-engine-plugin as well.

It contains the piece of code to parse the connector extension of the bpmn file.

Hope this helps, Ingo

@Ingo_Richtsmeier do you mean this plugin?

<dependency>
  <groupId>org.camunda.bpm</groupId>
  <artifactId>camunda-engine-plugin-connect</artifactId>
</dependency>
1 Like

Yes. give it a try.

1 Like

@Ingo_Richtsmeier after adding the camunda-engine-plugin-connect dependency also the issue persists.

dependencies added for mail-connectors are:

compile group: 'org.camunda.bpm', name: 'camunda-engine-plugin-connect', version: '7.11.0'
compile group: 'org.camunda.connect', name: 'camunda-connect-connectors-all', version: '1.2.2'
compile group: 'org.camunda.connect', name: 'camunda-connect-core', version: '1.2.2'
compile group: 'org.camunda.bpm.extension', name: 'camunda-bpm-mail-core', version: '1.2.0'
compile group: 'com.sun.mail', name: 'javax.mail', version: '1.6.2'

@Ingo_Richtsmeier i have found similar topic which you created, exactly the same issue im facing now. How did you solved it?

Also found few jira tickets related to this issue:

https://app.camunda.com/jira/browse/CAM-6365

Method isServiceTaskLike does not recognize that connector is set on a send task: https://app.camunda.com/jira/browse/CAM-5547

Exception which i got while deploying bpmn is:

e[1;31m[org.camunda.bpm.engine.context]e[0;39m e[31m[logError]e[0;39m @ 160 : e[32mENGINE-16004 Exception while closing command context: ENGINE-09005 Could not parse BPMN process. Errors: 
* One of the attributes 'class', 'delegateExpression', 'type', or 'expression' is mandatory on sendTask. | orderprocess.bpmn | line 8 | column 109
* One of the attributes 'class', 'delegateExpression', 'type', or 'expression' is mandatory on sendTask. | orderprocess.bpmn | line 35 | column 108e[0;39m

@Ingo_Richtsmeier i’m not sure how you solved the above issue. When i woke up next day morning, i found an idea and it worked, solved in 2 mins :slight_smile:

Here’s my solution to the problem. Not sure why i didn’t thought about the below configuration :frowning: Finally i was able to deploy the process with connectors config in SendTask :slight_smile:

List<ProcessEnginePlugin> processEnginePlugins = CollectionUtils
        .isNotEmpty(processEngineConfig.getProcessEnginePlugins()) ? processEngineConfig.getProcessEnginePlugins()
            : new ArrayList<>();
processEnginePlugins.addAll(Arrays.asList(new ConnectProcessEnginePlugin(), new SpinProcessEnginePlugin()));
processEngineConfig.setProcessEnginePlugins(processEnginePlugins);

After looking at the below code i added the above config and it worked :slight_smile:

public class ConnectProcessEnginePlugin extends AbstractProcessEnginePlugin {...}

This solved it for me!
Big Thanks!