AnsweredAssumed Answered

Problems with Email Configuration

Question asked by mwolf on Jan 13, 2017
Latest reply on Feb 14, 2017 by mwolf

Hey Everybody! I Use Activit in Karaf, an OSGI Container. To make the E-Mail Configuration Editable during runtime i put the valuses into an *.cfg folder. In the Blueprint i load the config from the cfg file. 

 

 

 

<cm:property-placeholder persistent-id="com.example.bpmn" update-strategy="reload"  placeholder-prefix="$["
                         placeholder-suffix="]">
    <cm:default-properties>
        <cm:property name="cfg.mailServerHost" value="localhost" />
        <cm:property name="cfg.mailServerUsername" value="admin" />
        <cm:property name="cfg.mailServerPassword" value="admin" />
        <cm:property name="cfg.mailServerPort" value="25" />
        <cm:property name="cfg.useSSL" value="true" />
        <cm:property name="cfg.useTLS" value="true" />
        <cm:property name="cfg.mailServerDefaultFrom" value="johndoe@localhost" />
    </cm:default-properties>
</cm:property-placeholder>

<bean id="dataSource" class="org.h2.jdbcx.JdbcDataSource">
    <property name="URL" value="jdbc:h2:~/activiti"/>
    <property name="user" value="sa"/>
    <property name="password" value=""/>
</bean>

<reference id="transactionManager" interface="javax.transaction.TransactionManager"/>


<bean id="configuration" class="org.activiti.engine.impl.cfg.JtaProcessEngineConfiguration"
      ext:field-injection="true">
    <property name="databaseType" value="h2"/>
    <property name="dataSource" ref="dataSource"/>
    <property name="transactionManager" ref="transactionManager"/>
    <property name="databaseSchemaUpdate" value="true"/>
    <property name="transactionsExternallyManaged" value="true"/>
    <property name="defaultCamelContext" value="defaultContext"/>
    <property name="mailServerHost" value="$[cfg.mailServerHost]"/>
    <property name="mailServerUsername" value="$[cfg.mailServerUsername]"/>
    <property name="mailServerPassword" value="$[cfg.mailServerPassword]"/>
    <property name="mailServerPort" value="$[cfg.mailServerPort]"/>
    <property name="useSSL" value="$[cfg.useSSL]" />
    <property name="useTLS" value="$[cfg.useTLS]" />
    <property name="mailServerDefaultFrom" value="$[cfg.mailServerDefaultFrom]"/>
</bean>

 

This works fine for me but if i have a Email Server without Authentication i earn an Error if i pass only empty values into the mailServerUsername and the mailServerPassword. Only Surrounding in the blueprint with a comment, so nothing pass into the process engine helps for this. is it possible to make this Optional in the config? 

Outcomes