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

org.kie.kogito.examples.ApplicationProcesses Maven / Gradle / Ivy

There is a newer version: 0.9.0
Show newest version
package org.kie.kogito.examples;

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import javax.annotation.PostConstruct;
import org.kie.kogito.Model;
import org.kie.kogito.process.Process;
import org.kie.kogito.process.Processes;

@javax.enterprise.context.ApplicationScoped()
public class ApplicationProcesses implements Processes {

    @javax.inject.Inject()
    javax.enterprise.inject.Instance> processes;

    private Map> mappedProcesses = new HashMap<>();

    @PostConstruct
    public void setup() {
        for (Process process : processes) {
            mappedProcesses.put(process.id(), process);
        }
    }

    public Process processById(String processId) {
        return mappedProcesses.get(processId);
    }

    public Collection processIds() {
        return mappedProcesses.keySet();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy