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?
I have the same problem in working with college essay writing service.
Thank you!
Well, this works. The Problem is if you want to use both, depending on the installation then you have to rebuild the complete project for this change. if i leave the fields empty, they will also send a empty username and password to the server, but this is not the same like having no auth parameters. i want to set them optional... is there any chance?
Yeah, this is what I expected. If you look at the configuration impl class, the userid and password are null unless declared.
By declaring a "" it is no longer null and is being passed in.
Short of building a custom configuration impl class (which isn't hard, just extend the class you are using) you can't have it both ways.
Greg
Can you provide an example for overwriting this? i am not really deep in spring.
The only way I figured out to handle this to comment it out. it is not the best option but it works for me. Thank you!
Ask for and offer help to other Alfresco Process Services and Activiti Users and members of the Alfresco team.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.