We are setting up a flowable application to use multiple bpmns with reusable java delegates. In application.yml, we have properties set for each bpmn
e.g.
app1.mail.active: true
app2.mail.active: false
ApplicationProperties file is set with @ConfigurationProperties() to get the properties.
Created a Spring bean:
@Bean("applicationProperties")
public ApplicationProperties applicationProperties(){
return new ApplicationProperties();
}
I am trying to use a script task using groovy and initialize the appropriate properties. It seems Spring beans are not available inside the script.
<scriptTask id="sid-C8B8BE3F-F6CB-4559-B48C-5BC14AB76494" name="Initialize Process" scriptFormat="groovy">
<script><![CDATA[
// I want to be able to access applicationProperties bean here
def _properties = applicationProperties.getApp1()
execution.setVariable("properties", _properties)
]]></script>
</scriptTask>
When initializing bpmn for app1, I want to set a variable for properties related to app1 and similar to app2. I am able to use existing spring beans elsewhere in the same bpmn but not inside groovy script task.
Thank you in advance.