com.netgrif.application.engine.workflow.domain.CachedFunction Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of application-engine Show documentation
Show all versions of application-engine Show documentation
System provides workflow management functions including user, role and data management.
package com.netgrif.application.engine.workflow.domain;
import com.netgrif.application.engine.petrinet.domain.Function;
import groovy.lang.Closure;
import groovy.lang.GroovyShell;
import lombok.Builder;
import lombok.Data;
@Builder
@Data
public class CachedFunction {
private final Function function;
private final Closure code;
public static CachedFunction build(GroovyShell shell, Function function) {
Closure code = (Closure) shell.evaluate(function.getDefinition());
if (code == null) {
throw new IllegalArgumentException("Non compilable function");
}
return CachedFunction.builder()
.code(code)
.function(function)
.build();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy