Kyrestia
Kyrestia, named after Kyrestia the Firstborne, is a process engine supporting mainstream process definition standards. It is not only lightweight, easy and fast to use, but also has plenty of advanced features. Kyrestia can be integrated into large-scale web applications and microservices to orchestrate business processes, as well as used by offline systems in traditional scenarios.
Features
- Consistency: Executions are always in a consistent status when visited by any thread at any time.
- Durability: Data of executions can be persisted and restored for later usage.
- Configurability: Behaviors are customizable by modifying settings.
- More features to be added...
Philosophy
- KISS: Keep it simple and stupid, and keep the word.
- Standalone: Literally no third-party JARs.
- Standardization: Embrace BPMN 2.0.
- Extensibility: Can be extended by implementing extension points.
- Performance: Pure memory operations and no redundant runtime objects created.
User Guide
Native Interface (Recommended)
Maven Dependency
<dependency>
<groupId>clan.midnightgroupId>
<artifactId>kyrestia-nativeartifactId>
<version>1.0.0version>
dependency>
Sample Code Snippet
Define BPMN process and execute
KyrestiaEngine engine = new KyrestiaEngine();
InputStream inputStream = Thread.currentThread().getContextClassLoader()
.getResourceAsStream("your-bpmn.xml");
// load process definition to memory
engine.deployBPMN(inputStream);
// create an execution
Execution execution = engine.execute(deployedProcessId, initialParameters);
execution.run();
Persist execution
// create the persistence object from an execution
ExecutionPO executionPO = engine.convertExecutionForPersistence(execution);
// restore from an persistence object
execution = engine.restore(executionPO);
execution.proceed();
Integration with Spring
Config Kyrestia engine
@Configuration
public class YourConfiguration {
@Autowired
private ApplicationContext applicationContext;
@Bean
public KyrestiaEngine kyrestiaEngine() {
Configuration.implementationAccessor = new ImplementationAccessor() {
@Override
public Object access(String identifier) {
Class clazz = ClassUtils.loadClass(identifier);
return applicationContext.getBean(clazz);
}
}
KyrestiaEngine engine = new KyrestiaEngine();
InputStream inputStream = Thread.currentThread().getContextClassLoader()
.getResourceAsStream("your-bpmn.xml");
engine.deployBPMN(inputStream);
return engine;
}
}
Delegate BPMN task
@Component
public class DelegationTest implements Delegation {
@Override
public void execute(DelegationContext context) {
// business logic
}
}
Acknowledgement
Inspired by Alibaba's SmartEngine