0

In our project we have a task of sending notification to some user after some task is completed.

Following is the code written in the BPMN2.0 xml -

<serviceTask id="notifyPartner" name="Notify Partner" flowable:type="mail">
      <documentation>Notify Partner about the assignment.</documentation>
      <extensionElements>
        <flowable:field name="to">
          <flowable:string><![CDATA[testemail@some.com]]></flowable:string>
        </flowable:field>
        <flowable:field name="from">
          <flowable:string><![CDATA[testemail@some.com]]></flowable:string>
        </flowable:field>
        <flowable:field name="subject">
          <flowable:string><![CDATA[Notify Partner]]></flowable:string>
        </flowable:field>
        <flowable:field name="text">
          <flowable:string><![CDATA[Notify Partner about the assignment.]]></flowable:string>
        </flowable:field>
      </extensionElements>
    </serviceTask>

With a application.properties as -

spring.flowable.mailServerHost=smtp.gmail.com
spring.flowable.mailServerPort=587
spring.flowable.mailServerUserName=testemail@some.com
spring.flowable.mailServerPassword=****
spring.flowable.mailServerUseTls=true

But all this results in no success. It gives the following error -

java.net.ConnectException: Connection refused (Connection refused)
    at java.net.PlainSocketImpl.socketConnect(Native Method)

I even tried setting up all the properties in flowable.cfg.xml also

 <property name="mailServerHost" value="smtp.gmail.com" />
    <property name="mailServerPort" value="587" />
    <property name="mailServerUseTls" value="true" />
    <property name="mailServerUsername" value="testemail@some.com" />
    <property name="mailServerPassword" value="****" />

Is there any other configuration missing? Flowable version used is 6.2.1.

Sri9911
  • 1,187
  • 16
  • 32

1 Answers1

1

In case you are using the Spring Boot starter for Flowable 6.2.1 you will need to remove the leading spring. from your properties.

Your properties should look like:

flowable.mailServerHost=smtp.gmail.com
flowable.mailServerPort=587
flowable.mailServerUserName=testemail@some.com
flowable.mailServerPassword=****
flowable.mailServerUseTls=true

When using Spring Boot the flowable.cfg.xml is not being used to configure the engine.

NOTE: When migrating to Flowable 6.3.x the properties have slightly changed and they need to look like:

flowable.mail.server.host=smtp.gmail.com
flowable.mail.server.port=587
flowable.mail.server.username=testemail@some.com
flowable.mail.server.password=****
flowable.mail.server.use-tls=true
Filip
  • 19,269
  • 7
  • 51
  • 60