io.automatiko.engine.service.dev.WorkflowInfoSupplier Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of automatiko-service Show documentation
Show all versions of automatiko-service Show documentation
Workflow as a Service - processes and decisions with Automatiko Engine
The newest version!
package io.automatiko.engine.service.dev;
import java.util.ArrayList;
import java.util.Collection;
import java.util.function.Supplier;
import io.automatiko.engine.api.workflow.Process;
import io.automatiko.engine.workflow.AbstractProcess;
import io.automatiko.engine.workflow.process.core.WorkflowProcess;
import io.quarkus.arc.Arc;
import jakarta.enterprise.inject.Any;
import jakarta.enterprise.util.AnnotationLiteral;
import jakarta.enterprise.util.TypeLiteral;
public class WorkflowInfoSupplier implements Supplier> {
@SuppressWarnings("serial")
@Override
public Collection get() {
Collection processes = new ArrayList();
Arc.container().select(new TypeLiteral>() {
}, new AnnotationLiteral() {
}).forEach(p -> {
processes.add(new WorkflowInfo(p.id(), p.name(), isPublic(p),
(String) ((AbstractProcess>) p).process().getMetaData().get("Documentation")));
});
return processes;
}
private boolean isPublic(Process> p) {
String visibility = ((WorkflowProcess) ((AbstractProcess>) p).process()).getVisibility();
if (WorkflowProcess.PUBLIC_VISIBILITY.equals(visibility) || WorkflowProcess.NONE_VISIBILITY.equals(visibility)) {
return true;
}
return false;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy