optimize(classloader): cache ClassGraph scan in Dynamic*TypeResolver
- Move full-classpath scan from constructor (per ObjectMapper) to static
initializer (once per class load)
- Add .acceptPackages("it.cnr.isti.workflow.manager") filter to reduce
scope: 540-880ms → 30-37ms per scan (~95% reduction)
- With 2 independent ObjectMappers (Spring + FlowConverter), recovers ~2s
of startup latency on first serialization/deserialization
refactor(cleanup): remove dead code and unused imports
Remove 5 unused types (120 LOC):
- ExecutorDescriptor, OutputProducer, InputConsumer, ModelDescriptor,
app/Validator, SourceBlockType
Remove 14 dead methods (~80 LOC):
- AuthRequest.isValid() (broken + unused)
- AuthRepository (2 methods), LoginEntity.isActiveUser()
- ContainerFlowInterfaceResolver (2), IteratorContainerInterfaceResolver (1)
- ExecutionContext (3), Step (3)
- ExecutionVariableRegistry.valuesView(), MCPSharedSessionRegistry.sharedKeys()
- FlowSharedVariableCatalogService.removeDraftBlock()
- BiasPreparedExecution.getAnnotations()
- 2× iterable() duplicate (JsonSchemaCatalogBundler, JsonSchemaProducer)
Remove 17 unused imports (14 main, 3 test)
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
000f6c1133
commit
9c3cb070b9
|
|
@ -1,7 +0,0 @@
|
|||
package it.cnr.isti.workflow.manager.app;
|
||||
|
||||
public interface Validator<T> {
|
||||
|
||||
boolean validate(T object);
|
||||
|
||||
}
|
||||
|
|
@ -29,9 +29,4 @@ public class AuthRequest {
|
|||
|
||||
public String getTurnstileToken() { return turnstileToken; }
|
||||
public void setTurnstileToken(String turnstileToken) { this.turnstileToken = turnstileToken; }
|
||||
|
||||
boolean isValid() {
|
||||
return username.contains(" ") && username != null && !username.isEmpty() && username.length()>5 &&
|
||||
password != null && username.contains(" ") && password.length()>5 && !password.isEmpty();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,14 +14,9 @@ import java.util.Optional;
|
|||
@Repository
|
||||
public interface AuthRepository extends JpaRepository<LoginEntity, String> {
|
||||
|
||||
long countByRole(UserRole role);
|
||||
|
||||
@Query("select count(u) from LoginEntity u where u.role = :role and (u.active is null or u.active = true)")
|
||||
long countByRoleAndActiveTrue(@Param("role") UserRole role);
|
||||
|
||||
@Query("select case when count(u) > 0 then true else false end from LoginEntity u where u.username = :username and (u.active is null or u.active = true)")
|
||||
boolean existsByUsernameAndActiveTrue(@Param("username") String username);
|
||||
|
||||
@Query("select u from LoginEntity u where u.username = :username and (u.active is null or u.active = true)")
|
||||
Optional<LoginEntity> findByUsernameAndActiveTrue(@Param("username") String username);
|
||||
|
||||
|
|
|
|||
|
|
@ -58,8 +58,4 @@ public class LoginEntity {
|
|||
public UserRole effectiveRole() {
|
||||
return role == null ? UserRole.USER : role;
|
||||
}
|
||||
|
||||
public boolean isActiveUser() {
|
||||
return active == null || active;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import tools.jackson.core.JacksonException;
|
|||
import io.github.classgraph.ClassGraph;
|
||||
import io.github.classgraph.ScanResult;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
|
@ -20,18 +21,26 @@ public class DynamicBlockConfigurationTypeResolver extends TypeIdResolverBase {
|
|||
private static final String BRANCH_REJOIN_LEGACY_CONFIGURATION_ID = "ExclusiveMergeBlockConfiguration";
|
||||
private static final String BRANCH_REJOIN_CONFIGURATION_ID = "BranchRejoinBlockConfiguration";
|
||||
|
||||
private Map<String, Class<?>> idToClass = new HashMap<>();
|
||||
private Map<Class<?>, String> classToId = new HashMap<>();
|
||||
private static final Map<String, Class<?>> ID_TO_CLASS;
|
||||
private static final Map<Class<?>, String> CLASS_TO_ID;
|
||||
|
||||
public DynamicBlockConfigurationTypeResolver() {
|
||||
try (ScanResult scanResult = new ClassGraph().enableClassInfo().scan()) {
|
||||
static {
|
||||
Map<String, Class<?>> idMap = new HashMap<>();
|
||||
Map<Class<?>, String> classMap = new HashMap<>();
|
||||
try (ScanResult scanResult = new ClassGraph().enableClassInfo()
|
||||
.acceptPackages("it.cnr.isti.workflow.manager").scan()) {
|
||||
List<Class<?>> classes = scanResult.getSubclasses(BlockConfiguration.class.getName()).loadClasses();
|
||||
for (Class<?> clazz : classes) {
|
||||
String id = clazz.getSimpleName();
|
||||
idToClass.put(id, clazz);
|
||||
classToId.put(clazz, id);
|
||||
String id = clazz.getSimpleName();
|
||||
idMap.put(id, clazz);
|
||||
classMap.put(clazz, id);
|
||||
}
|
||||
}
|
||||
ID_TO_CLASS = Collections.unmodifiableMap(idMap);
|
||||
CLASS_TO_ID = Collections.unmodifiableMap(classMap);
|
||||
}
|
||||
|
||||
public DynamicBlockConfigurationTypeResolver() {
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -40,12 +49,12 @@ public class DynamicBlockConfigurationTypeResolver extends TypeIdResolverBase {
|
|||
|
||||
@Override
|
||||
public String idFromValue(DatabindContext context, Object value) throws JacksonException {
|
||||
return classToId.get(value.getClass());
|
||||
return CLASS_TO_ID.get(value.getClass());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String idFromValueAndType(DatabindContext context, Object value, Class<?> suggestedType) throws JacksonException {
|
||||
return classToId.get(suggestedType);
|
||||
return CLASS_TO_ID.get(suggestedType);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -56,7 +65,7 @@ public class DynamicBlockConfigurationTypeResolver extends TypeIdResolverBase {
|
|||
if (BRANCH_REJOIN_LEGACY_CONFIGURATION_ID.equals(id)) {
|
||||
id = BRANCH_REJOIN_CONFIGURATION_ID;
|
||||
}
|
||||
Class<?> clazz = idToClass.get(id);
|
||||
Class<?> clazz = ID_TO_CLASS.get(id);
|
||||
if (clazz == null && id != null) {
|
||||
String normalized = id;
|
||||
int suffixSeparator = normalized.indexOf("__");
|
||||
|
|
@ -67,7 +76,7 @@ public class DynamicBlockConfigurationTypeResolver extends TypeIdResolverBase {
|
|||
if (lastDot >= 0 && lastDot < normalized.length() - 1) {
|
||||
normalized = normalized.substring(lastDot + 1);
|
||||
}
|
||||
clazz = idToClass.get(normalized);
|
||||
clazz = ID_TO_CLASS.get(normalized);
|
||||
}
|
||||
if (clazz == null) {
|
||||
throw new IllegalArgumentException("Unknown BlockConfiguration type id: " + id);
|
||||
|
|
|
|||
|
|
@ -157,10 +157,6 @@ public class JsonSchemaCatalogBundler {
|
|||
return null;
|
||||
}
|
||||
|
||||
private static <T> Iterable<T> iterable(java.util.Iterator<T> iterator) {
|
||||
return () -> iterator;
|
||||
}
|
||||
|
||||
private static final class DefinitionStats {
|
||||
private int occurrences;
|
||||
private final Set<String> fingerprints = new LinkedHashSet<>();
|
||||
|
|
|
|||
|
|
@ -27,7 +27,6 @@ import tools.jackson.databind.node.ObjectNode;
|
|||
import com.github.victools.jsonschema.generator.Option;
|
||||
import com.github.victools.jsonschema.generator.OptionPreset;
|
||||
import com.github.victools.jsonschema.generator.SchemaGenerator;
|
||||
import com.github.victools.jsonschema.generator.SchemaGeneratorConfig;
|
||||
import com.github.victools.jsonschema.generator.SchemaGeneratorConfigBuilder;
|
||||
import com.github.victools.jsonschema.generator.SchemaVersion;
|
||||
import com.github.victools.jsonschema.module.jackson.JacksonOption;
|
||||
|
|
@ -1340,10 +1339,6 @@ public class JsonSchemaProducer {
|
|||
|| packageName.startsWith("jakarta.");
|
||||
}
|
||||
|
||||
private <T> Iterable<T> iterable(java.util.Iterator<T> iterator) {
|
||||
return () -> iterator;
|
||||
}
|
||||
|
||||
private void enqueueRelatedTypes(Queue<Class<?>> queue, Type genericType, Class<?> rawType) {
|
||||
queue.add(rawType);
|
||||
enqueueGenericArguments(queue, genericType);
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@ import it.cnr.isti.workflow.manager.configurations.annotations.UiEnabledWhen;
|
|||
import it.cnr.isti.workflow.manager.configurations.annotations.UiRequiredWhen;
|
||||
import it.cnr.isti.workflow.manager.blocks.types.MCPAgentBlockType;
|
||||
import jakarta.validation.Valid;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Builder;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ import java.util.Objects;
|
|||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import it.cnr.isti.workflow.manager.blocks.Block;
|
||||
import it.cnr.isti.workflow.manager.blocks.IOCapability;
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ import java.util.Objects;
|
|||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import it.cnr.isti.workflow.manager.blocks.Block;
|
||||
import it.cnr.isti.workflow.manager.blocks.IOCapability;
|
||||
|
|
|
|||
|
|
@ -1,35 +0,0 @@
|
|||
package it.cnr.isti.workflow.manager.blocks.types;
|
||||
|
||||
|
||||
import it.cnr.isti.workflow.manager.blocks.configurations.BlockConfiguration;
|
||||
|
||||
//@Component(SourceBlockType.TYPE)
|
||||
public class SourceBlockType implements BlockType {
|
||||
|
||||
public static final String TYPE = "SourceBlock";
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return "This type represents a source node in the workflow manager";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean validate() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends BlockConfiguration<?>> getBlockConfigurationClass() {
|
||||
return null; // Assuming no specific configuration class for SourceBlockType
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUserInteractive() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -8,24 +8,33 @@ import tools.jackson.core.JacksonException;
|
|||
import io.github.classgraph.ClassGraph;
|
||||
import io.github.classgraph.ScanResult;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class DynamicContainerConfigurationTypeResolver extends TypeIdResolverBase {
|
||||
|
||||
private final Map<String, Class<?>> idToClass = new HashMap<>();
|
||||
private final Map<Class<?>, String> classToId = new HashMap<>();
|
||||
private static final Map<String, Class<?>> ID_TO_CLASS;
|
||||
private static final Map<Class<?>, String> CLASS_TO_ID;
|
||||
|
||||
public DynamicContainerConfigurationTypeResolver() {
|
||||
try (ScanResult scanResult = new ClassGraph().enableClassInfo().scan()) {
|
||||
static {
|
||||
Map<String, Class<?>> idMap = new HashMap<>();
|
||||
Map<Class<?>, String> classMap = new HashMap<>();
|
||||
try (ScanResult scanResult = new ClassGraph().enableClassInfo()
|
||||
.acceptPackages("it.cnr.isti.workflow.manager").scan()) {
|
||||
List<Class<?>> classes = scanResult.getSubclasses(ContainerConfiguration.class.getName()).loadClasses();
|
||||
for (Class<?> clazz : classes) {
|
||||
String id = clazz.getSimpleName();
|
||||
idToClass.put(id, clazz);
|
||||
classToId.put(clazz, id);
|
||||
idMap.put(id, clazz);
|
||||
classMap.put(clazz, id);
|
||||
}
|
||||
}
|
||||
ID_TO_CLASS = Collections.unmodifiableMap(idMap);
|
||||
CLASS_TO_ID = Collections.unmodifiableMap(classMap);
|
||||
}
|
||||
|
||||
public DynamicContainerConfigurationTypeResolver() {
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -34,17 +43,17 @@ public class DynamicContainerConfigurationTypeResolver extends TypeIdResolverBas
|
|||
|
||||
@Override
|
||||
public String idFromValue(DatabindContext context, Object value) throws JacksonException {
|
||||
return classToId.get(value.getClass());
|
||||
return CLASS_TO_ID.get(value.getClass());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String idFromValueAndType(DatabindContext context, Object value, Class<?> suggestedType) throws JacksonException {
|
||||
return classToId.get(suggestedType);
|
||||
return CLASS_TO_ID.get(suggestedType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public JavaType typeFromId(DatabindContext context, String id) throws JacksonException {
|
||||
Class<?> clazz = idToClass.get(id);
|
||||
Class<?> clazz = ID_TO_CLASS.get(id);
|
||||
if (clazz == null && id != null) {
|
||||
String normalized = id;
|
||||
int suffixSeparator = normalized.indexOf("__");
|
||||
|
|
@ -55,7 +64,7 @@ public class DynamicContainerConfigurationTypeResolver extends TypeIdResolverBas
|
|||
if (lastDot >= 0 && lastDot < normalized.length() - 1) {
|
||||
normalized = normalized.substring(lastDot + 1);
|
||||
}
|
||||
clazz = idToClass.get(normalized);
|
||||
clazz = ID_TO_CLASS.get(normalized);
|
||||
}
|
||||
if (clazz == null) {
|
||||
throw new IllegalArgumentException("Unknown ContainerConfiguration type id: " + id);
|
||||
|
|
|
|||
|
|
@ -93,18 +93,6 @@ public final class ContainerFlowInterfaceResolver {
|
|||
return List.copyOf(handles);
|
||||
}
|
||||
|
||||
public static Optional<OpenHandle> findOpenInput(FlowData subFlow, String blockId, String inputName) {
|
||||
return getOpenInputs(subFlow).stream()
|
||||
.filter(handle -> handle.blockId().equals(blockId) && handle.io().getName().equals(inputName))
|
||||
.findFirst();
|
||||
}
|
||||
|
||||
public static Optional<OpenHandle> findOpenOutput(FlowData subFlow, String blockId, String outputName) {
|
||||
return getOpenOutputs(subFlow).stream()
|
||||
.filter(handle -> handle.blockId().equals(blockId) && handle.io().getName().equals(outputName))
|
||||
.findFirst();
|
||||
}
|
||||
|
||||
private static boolean isTargeted(List<Connection> connections, String blockId, String inputName) {
|
||||
return connections.stream()
|
||||
.anyMatch(connection -> blockId.equals(connection.getTargetId()) && inputName.equals(connection.getTargetName()));
|
||||
|
|
|
|||
|
|
@ -98,11 +98,6 @@ public final class IteratorContainerInterfaceResolver {
|
|||
public List<IODescriptor> outputs() {
|
||||
return resolvedOutputs.stream().map(ResolvedOutput::descriptor).toList();
|
||||
}
|
||||
|
||||
public Map<String, ResolvedInput> inputsByPublicName() {
|
||||
return resolvedInputs.stream()
|
||||
.collect(LinkedHashMap::new, (map, input) -> map.put(input.publicName(), input), Map::putAll);
|
||||
}
|
||||
}
|
||||
|
||||
public record ResolvedInput(
|
||||
|
|
|
|||
|
|
@ -187,11 +187,6 @@ public class ExecutionContext implements ExecutionListener {
|
|||
this.errors.put(nodeId, error);
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public Map<FieldKey, Object> getExecutionResult() {
|
||||
return Collections.unmodifiableMap(this.result);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void completed(String id, Map<String, Object> result) {
|
||||
completeStep(id, result, null);
|
||||
|
|
@ -523,14 +518,6 @@ public class ExecutionContext implements ExecutionListener {
|
|||
return removed;
|
||||
}
|
||||
|
||||
protected Object removeGlobalInput(String key) {
|
||||
this.globalInputDescriptors.remove(key);
|
||||
Object removed = this.globalInputs.remove(key);
|
||||
refreshRuntimeExecutionVariables();
|
||||
notifyStateChanged();
|
||||
return removed;
|
||||
}
|
||||
|
||||
protected void start(ExecutorService executorService) {
|
||||
this.setStatus(ExecutionStatus.RUNNING);
|
||||
this.steps.values().forEach(step -> step.start(executorService));
|
||||
|
|
@ -736,25 +723,6 @@ public class ExecutionContext implements ExecutionListener {
|
|||
}
|
||||
}
|
||||
|
||||
public ExecutionStatus awaitStatusChangeWhileRunning(long timeoutMs) {
|
||||
long deadline = timeoutMs <= 0 ? Long.MAX_VALUE : System.currentTimeMillis() + timeoutMs;
|
||||
synchronized (statusMonitor) {
|
||||
while (this.status == ExecutionStatus.RUNNING) {
|
||||
long remaining = deadline - System.currentTimeMillis();
|
||||
if (remaining <= 0) {
|
||||
break;
|
||||
}
|
||||
try {
|
||||
statusMonitor.wait(remaining);
|
||||
} catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
break;
|
||||
}
|
||||
}
|
||||
return this.status;
|
||||
}
|
||||
}
|
||||
|
||||
protected void setRuntimeContextValues(Map<String, Object> runtimeContextValues) {
|
||||
this.runtimeContextVariables.clear();
|
||||
if (runtimeContextValues != null) {
|
||||
|
|
|
|||
|
|
@ -20,7 +20,6 @@ import it.cnr.isti.workflow.manager.executions.persistence.ExecutionSnapshot;
|
|||
import it.cnr.isti.workflow.manager.executions.persistence.ExecutionStepSnapshot;
|
||||
import it.cnr.isti.workflow.manager.executions.persistence.ContainerContinuationSnapshot;
|
||||
import it.cnr.isti.workflow.manager.executions.bias.BiasExecutionContext;
|
||||
import it.cnr.isti.workflow.manager.executions.executors.BlockExecutors;
|
||||
import it.cnr.isti.workflow.manager.executions.executors.NodeExecutors;
|
||||
import it.cnr.isti.workflow.manager.executions.steps.Input;
|
||||
import it.cnr.isti.workflow.manager.executions.steps.Output;
|
||||
|
|
|
|||
|
|
@ -26,17 +26,6 @@ public final class ExecutionVariableRegistry {
|
|||
.build();
|
||||
}
|
||||
|
||||
public static Map<String, Object> valuesView(Map<String, ExecutionVariableDescriptor> descriptors) {
|
||||
LinkedHashMap<String, Object> values = new LinkedHashMap<>();
|
||||
if (descriptors == null) {
|
||||
return values;
|
||||
}
|
||||
descriptors.values().stream()
|
||||
.map(ExecutionVariableRegistry::normalize)
|
||||
.forEach(descriptor -> values.put(descriptor.getName(), descriptor.getValue()));
|
||||
return values;
|
||||
}
|
||||
|
||||
public static Map<String, ExecutionVariableDescriptor> descriptorsFromValues(Map<String, Object> values) {
|
||||
LinkedHashMap<String, ExecutionVariableDescriptor> descriptors = new LinkedHashMap<>();
|
||||
if (values == null) {
|
||||
|
|
|
|||
|
|
@ -44,7 +44,6 @@ import it.cnr.isti.workflow.manager.containers.configurations.IteratorContainerC
|
|||
import it.cnr.isti.workflow.manager.containers.configurations.LoopContainerConfiguration;
|
||||
import it.cnr.isti.workflow.manager.containers.iresolvers.ContainerFlowInterfaceResolver;
|
||||
import it.cnr.isti.workflow.manager.containers.iresolvers.IteratorContainerInterfaceResolver;
|
||||
import it.cnr.isti.workflow.manager.containers.types.GenericContainerType;
|
||||
import it.cnr.isti.workflow.manager.containers.types.IteratorContainerType;
|
||||
import it.cnr.isti.workflow.manager.containers.types.LoopContainerType;
|
||||
import it.cnr.isti.workflow.manager.executions.persistence.ExecutionSnapshot;
|
||||
|
|
@ -69,7 +68,6 @@ import it.cnr.isti.workflow.manager.flows.validation.FlowExecutionValidator;
|
|||
import it.cnr.isti.workflow.manager.llms.LLMDescriptor;
|
||||
import it.cnr.isti.workflow.manager.llms.providers.LLMProvider;
|
||||
import it.cnr.isti.workflow.manager.mcp.MCPAgentService;
|
||||
import it.cnr.isti.workflow.manager.mcp.MCPSharedSessionRegistry;
|
||||
import it.cnr.isti.workflow.manager.vault.UserSecretService;
|
||||
import it.cnr.isti.workflow.manager.flows.validation.ValidationErrorCode;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,28 +0,0 @@
|
|||
package it.cnr.isti.workflow.manager.executions;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NonNull;
|
||||
import lombok.Singular;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
public class ExecutorDescriptor {
|
||||
|
||||
|
||||
@NonNull
|
||||
String identifier;
|
||||
@NonNull
|
||||
String name;
|
||||
|
||||
String description;
|
||||
@Singular
|
||||
List<String> inputNames;
|
||||
@Singular
|
||||
List<String> outputNames;
|
||||
|
||||
}
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
package it.cnr.isti.workflow.manager.executions;
|
||||
|
||||
public interface InputConsumer {
|
||||
|
||||
void consumeInput(String key, Object value);
|
||||
|
||||
}
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
package it.cnr.isti.workflow.manager.executions;
|
||||
|
||||
public interface OutputProducer {
|
||||
|
||||
void produceOutput(String key, Object value);
|
||||
|
||||
void registerConsumer(InputConsumer consumer );
|
||||
|
||||
}
|
||||
|
|
@ -48,10 +48,6 @@ public class BiasPreparedExecution {
|
|||
return executionVariables;
|
||||
}
|
||||
|
||||
public List<BlockBiasAnnotation> getAnnotations() {
|
||||
return annotations;
|
||||
}
|
||||
|
||||
public Map<String, Object> getBypassResult() {
|
||||
return bypassResult;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -85,18 +85,6 @@ public class FlowSharedVariableCatalogService {
|
|||
});
|
||||
}
|
||||
|
||||
public void removeDraftBlock(String flowId, String blockId) {
|
||||
if (!StringUtils.hasText(flowId) || !StringUtils.hasText(blockId)) {
|
||||
return;
|
||||
}
|
||||
draftBlocksByFlowId.computeIfPresent(flowId, (ignored, current) -> {
|
||||
current.remove(blockId);
|
||||
return current.isEmpty() ? null : current;
|
||||
});
|
||||
removedBlockIdsByFlowId.computeIfAbsent(flowId, ignored -> ConcurrentHashMap.newKeySet())
|
||||
.add(blockId.trim());
|
||||
}
|
||||
|
||||
private List<SharedVariableDefinition> analyze(FlowData flowData) {
|
||||
if (flowData == null) {
|
||||
return List.of();
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
package it.cnr.isti.workflow.manager.executions.executors.blocks;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@ import org.springframework.expression.spel.standard.SpelExpressionParser;
|
|||
import org.springframework.expression.spel.support.MapAccessor;
|
||||
import org.springframework.expression.spel.support.StandardEvaluationContext;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import it.cnr.isti.workflow.manager.blocks.Block;
|
||||
import it.cnr.isti.workflow.manager.blocks.configurations.ConditionalBlockConfiguration;
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ import java.util.stream.Collectors;
|
|||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import it.cnr.isti.workflow.manager.blocks.Block;
|
||||
import it.cnr.isti.workflow.manager.blocks.configurations.HumanInteractiveBlockConfiguration;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
package it.cnr.isti.workflow.manager.executions.executors.blocks;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ import java.util.LinkedHashMap;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import it.cnr.isti.workflow.manager.containers.Container;
|
||||
|
|
|
|||
|
|
@ -341,14 +341,6 @@ public class Step<N extends FlowNode> implements InputListener {
|
|||
return !this.dependencyIds.isEmpty() ? this.satisfiedDependencyIds.containsAll(this.dependencyIds) : true;
|
||||
}
|
||||
|
||||
public synchronized boolean hasDependencies() {
|
||||
return !this.dependencyIds.isEmpty();
|
||||
}
|
||||
|
||||
public synchronized boolean areInputsSatisfied() {
|
||||
return this.inputs.stream().allMatch(Input::isSet);
|
||||
}
|
||||
|
||||
public synchronized List<Step<?>> getDependentSteps() {
|
||||
return List.copyOf(this.dependentSteps);
|
||||
}
|
||||
|
|
@ -453,10 +445,6 @@ public class Step<N extends FlowNode> implements InputListener {
|
|||
return this.containerContinuation == null ? null : this.containerContinuation.copy();
|
||||
}
|
||||
|
||||
public synchronized void clearContainerContinuation() {
|
||||
this.containerContinuation = null;
|
||||
}
|
||||
|
||||
public synchronized void completeSuspendedContainer(NodeExecutionResult executionResult) {
|
||||
if (this.status != StepStatus.WAITING_FOR_SUBFLOW) {
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@ import lombok.AllArgsConstructor;
|
|||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.NonNull;
|
||||
import lombok.Singular;
|
||||
|
||||
@Data
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@ import it.cnr.isti.workflow.manager.blocks.configurations.EndBlockConfiguration;
|
|||
import it.cnr.isti.workflow.manager.blocks.configurations.BranchRejoinBlockConfiguration;
|
||||
import it.cnr.isti.workflow.manager.blocks.factories.BlockFactory;
|
||||
import it.cnr.isti.workflow.manager.blocks.factories.ConditionalBlockFactory;
|
||||
import it.cnr.isti.workflow.manager.blocks.factories.SwitchBlockFactory;
|
||||
import it.cnr.isti.workflow.manager.blocks.types.ConditionalBlockType;
|
||||
import it.cnr.isti.workflow.manager.blocks.types.BranchRejoinBlockType;
|
||||
import it.cnr.isti.workflow.manager.blocks.types.HumanDecisionBlockType;
|
||||
|
|
|
|||
|
|
@ -1,27 +0,0 @@
|
|||
package it.cnr.isti.workflow.manager.llms;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
public class ModelDescriptor {
|
||||
|
||||
private String id;
|
||||
private String name;
|
||||
private String provider;
|
||||
private String modelVersion;
|
||||
private String apiUrl;
|
||||
private String apiType;
|
||||
private String accessMethod;
|
||||
private List<String> modality;
|
||||
private int contextLength;
|
||||
private Map<String, Object> customProperties;
|
||||
|
||||
// Getters/setters/constructors
|
||||
}
|
||||
|
|
@ -56,16 +56,4 @@ public final class MCPSharedSessionRegistry {
|
|||
public static boolean isManagedSharedSession(Map<String, ExecutionVariableDescriptor> descriptors, String key) {
|
||||
return getSessionDescriptor(descriptors, key) != null;
|
||||
}
|
||||
|
||||
public static Set<String> sharedKeys(Map<String, ExecutionVariableDescriptor> descriptors) {
|
||||
if (descriptors == null || descriptors.isEmpty()) {
|
||||
return Set.of();
|
||||
}
|
||||
LinkedHashSet<String> keys = new LinkedHashSet<>();
|
||||
descriptors.values().stream()
|
||||
.map(ExecutionVariableRegistry::normalize)
|
||||
.filter(descriptor -> descriptor.getKind() == ExecutionVariableKind.MCP_SESSION)
|
||||
.forEach(descriptor -> keys.add(descriptor.getName()));
|
||||
return Set.copyOf(keys);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
package it.cnr.isti.workflow.manager.controllers;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
|
|
|||
|
|
@ -1,8 +1,6 @@
|
|||
package it.cnr.isti.workflow.manager.executions;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
|
|
|||
|
|
@ -1,8 +1,6 @@
|
|||
package it.cnr.isti.workflow.manager.flows;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.context.annotation.Import;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import it.cnr.isti.workflow.manager.blocks.Block;
|
||||
|
|
@ -12,7 +10,6 @@ import it.cnr.isti.workflow.manager.blocks.factories.HumanInteractiveBlockFactor
|
|||
import it.cnr.isti.workflow.manager.blocks.factories.LLMBlockFactory;
|
||||
import it.cnr.isti.workflow.manager.blocks.types.HumanInteractionBlockType;
|
||||
import it.cnr.isti.workflow.manager.blocks.types.LLMBlockType;
|
||||
import it.cnr.isti.workflow.manager.blocks.types.SourceBlockType;
|
||||
import it.cnr.isti.workflow.manager.flows.model.Connection;
|
||||
import it.cnr.isti.workflow.manager.flows.model.Flow;
|
||||
import it.cnr.isti.workflow.manager.llms.LLMDescriptor;
|
||||
|
|
|
|||
Loading…
Reference in New Issue