org.kie.kogito.examples.ApplicationProcesses Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jbpm-quarkus-example
Show all versions of jbpm-quarkus-example
Order management service
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 extends Model> process : processes) {
mappedProcesses.put(process.id(), process);
}
}
public Process extends Model> processById(String processId) {
return mappedProcesses.get(processId);
}
public Collection processIds() {
return mappedProcesses.keySet();
}
}