org.openbp.config.engine.StandardEngineConfig Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of openbp-server Show documentation
Show all versions of openbp-server Show documentation
The OpenBP process engine (main module)
package org.openbp.config.engine;
import org.openbp.server.engine.AutoCommittingEngineImpl;
import org.openbp.server.engine.Engine;
import org.openbp.server.engine.SessionMode;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* Spring configuration that provides a process engine that executes a database commit after
* calling the {@link #startToken}, {@link #resumeToken} or {@link #resumeWorkflow} methods.
* This must be done if you execute your tasks using an EngineRunner in a background thread,
* especially if you are running engine runners on several nodes of a cluster.
* However, if you execute the process within the current thread, this might be omitted.
* Typical cases might be batch processing or test cases.
*/
@Configuration
public class StandardEngineConfig
{
@Bean
public Engine engine()
{
AutoCommittingEngineImpl engine = new AutoCommittingEngineImpl();
engine.setSessionMode(SessionMode.AUTO);
return engine;
}
}