HEss
April 9, 2021, 11:48am
1
Hello everyone,
I’m beginner to Camunda. I wanna use send tasks to send emails using camunda-bpm-mail
When I’m trying to deploy the process to the engine, I got this error “One of the attributes ‘class’, ‘delegateExpression’, ‘type’, or ‘expression’ is mandatory on sendTask”.
Any help, thank you
Niall
April 9, 2021, 11:51am
2
You should upload your model so that we have some context as to what could be causing the error
HEss
April 9, 2021, 12:05pm
3
Hello @Niall ,
Thank you for your quick reply, You can find attached the process.process.bpmn (8.3 KB)
PS: each connector has its own address email
@HEss refer this post for similar issue was discussed and resolved.
@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
Here’s my solution to the problem. Not sure why i didn’t thought about the below configuration Finally i was able to deploy the process with connectors config in SendTask
[image]
List<ProcessEnginePlugin> processEnginePlugins = CollectionUtils
.isNotEmpty(processEngineConfig.getProcessEnginePlugins()) …
Also, make sure that you’ve the below plugin in pom.xml:
<dependency>
<groupId>org.camunda.bpm</groupId>
<artifactId>camunda-engine-plugin-connect</artifactId>
</dependency>
This plugin contains the piece of code to parse the connector extension of the bpmn file.
HEss
April 9, 2021, 12:38pm
5
Thank you @aravindhrs for your reply, actually I’ve already checked your post, and I want to ask you something
Is this example implemented by Spring boot or just a Maven project.
Have you attached this configuration class to implementation details of each sendTask.
Yes, it’s spring boot application.
Not required to attach at each send task level. The plugin takes care of it while parsing the activity.
public class ConnectorParseListener extends AbstractBpmnParseListener {
@Override
public void parseServiceTask(Element serviceTaskElement, ScopeImpl scope, ActivityImpl activity) {
Element connectorDefinition = findCamundaExtensionElement(serviceTaskElement, "connector");
if (connectorDefinition != null) {
Element connectorIdElement = connectorDefinition.element("connectorId");
String connectorId = null;
if (connectorIdElement != null) {
connectorId = connectorIdElement.getText().trim();
}
if (connectorIdElement == null || connectorId.isEmpty()) {
throw new BpmnParseException("No 'id' defined for connector.", connectorDefinition);
}
IoMapping ioMapping = parseInputOutput(connectorDefinition);
activity.setActivityBehavior(new ServiceTaskConnectorActivityBehavior(connectorId, ioMapping));
}
}