All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.automatiko.engine.workflow.bpmn2.BpmnProcesses Maven / Gradle / Ivy

There is a newer version: 0.36.0
Show newest version
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 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());
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy