Automatic resource deployment

Hi,

I have a question. When the process engine is created, all those resources will be scanned and deployed, but if one process fails, so automatically fails other processes and do not create processEngine. I have tried to use DeploymentMode and set SingleResourceAutoDeploymentStrategy, but still the same. I used Spring Boot.

Thanks for your advice.

You are correct, the SingleResourceAutoDeploymentStrategy deploys the processes as different deployments (vs one deployment for all in the default strategy), but when an exception occurs, the engine will not be instantiated.

A quick solution would be to extend the SingleResourceAutoDeploymentStrategy and surround a call to super.deployResources with a try-catch.

Thank you joram,

I’ve tried your solution (extend the SingleResourceAutoDeploymentStrategy and surround a call to super.deployResources with a try-catch), but it does not work. I found a problem with AutoDeploymentStrategy. I have overridden getAutoDeploymentStrategy and I have created custom AutoDeploymentStrategy, but it still does not work. I would like to add custom deploymentStrategie, but It’s a little complicated. I use Spring Boot.

I have no idea.

Thank you for any advice.

Did you add your custom AutoDeploymentStrategy to the deploymentStrategies list of the processEngineConfiguration? If you’re using Spring Boot, you can use the ProcessEngineConfigurationConfigurer bean get access to it.

I should have been clearer, you should still have to loop over all the Resources passed there and call super.deplyResources for each of them.

If you’re still stuck, can you post your code here, so we can take it from there?

Hello Joram:

I’ve ended up in this topic after reading the sources of SpringProcessEngineConfiguration.

I’m using the Spring-Boot with spring-boot-boot-starter-rest dependency, and I was trying to auto-deploy my workflow using defined properties like:

    flowable.check-process-definitions = true
    flowable.process-definition-location-prefix = classpath *: / processes /

The auto deploy worked fine, but for functional specifications purposes of my project, I need to start it using a tenant-id and this is the “gray” point in my understandings that I’m trying to reach.

I have read in sources that the Tenant-ID is setup during deployment time by concrete implementations of AbstractAutoDeploymentStrategy that will use the RepositoryService class to get a DeploymentBuilder.

I just tried to inject a custom bean of type ProcessEngineConfigurationConfigurer in my spring-boot application, but I could not access to DeploymentStrategy or DeploymentBuilder.

	@Bean
	public ProcessEngineConfigurationConfigurer processEngineConfigurationConfigurer(){
		return new ProcessEngineConfigurationConfigurer(){
		
			@Override
			public void configure(SpringProcessEngineConfiguration engineConfiguration) {
				//I could'n find a way to obtain or add a custom DeploymentStategy
				//engineConfiguration.add ...
			}
		};
	}

So, righ now I’m unable to setup a custom tenant-id for my auto-deploy configuration.

Could you point me to some directions on how to achieve what I’m looking for.

Thank you in advance and congrats for the awesome work on flowable projects.

1 Like