io.automatiko.engine.workflow.bpmn2.BpmnProcesses Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of automatiko-workflow-bpmn2 Show documentation
Show all versions of automatiko-workflow-bpmn2 Show documentation
BPMN2 Workflow support for Automatiko Engine
package io.automatiko.engine.workflow.bpmn2;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import io.automatiko.engine.api.Model;
import io.automatiko.engine.api.workflow.Process;
import io.automatiko.engine.api.workflow.Processes;
public class BpmnProcesses implements Processes {
private Map processes = new HashMap<>();
public BpmnProcesses(List processList) {
if (processList != null) {
for (BpmnProcess process : processList) {
this.processes.put(process.id(), process);
}
}
}
@Override
public Process extends Model> processById(String id) {
return processes.get(id);
}
@Override
public Collection processIds() {
return processes.keySet();
}
public Collection processes() {
return processes.values();
}
@Override
public void activate() {
processes.values().forEach(p -> p.activate());
}
@Override
public void deactivate() {
processes.values().forEach(p -> p.deactivate());
}
}