diff --git a/sdk-workflows/src/main/java/io/dapr/workflows/runtime/WorkflowRuntimeBuilder.java b/sdk-workflows/src/main/java/io/dapr/workflows/runtime/WorkflowRuntimeBuilder.java index b8465cdda0..f34005d4c0 100644 --- a/sdk-workflows/src/main/java/io/dapr/workflows/runtime/WorkflowRuntimeBuilder.java +++ b/sdk-workflows/src/main/java/io/dapr/workflows/runtime/WorkflowRuntimeBuilder.java @@ -16,10 +16,19 @@ import com.microsoft.durabletask.DurableTaskGrpcWorkerBuilder; import io.dapr.utils.NetworkUtils; import io.dapr.workflows.Workflow; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.HashSet; +import java.util.Set; public class WorkflowRuntimeBuilder { private static volatile WorkflowRuntime instance; private DurableTaskGrpcWorkerBuilder builder; + private static final Logger LOGGER = LoggerFactory.getLogger(WorkflowRuntimeBuilder.class); + private static volatile Set activity_Set = new HashSet(); + private static volatile Set workflow_Set = new HashSet(); + public WorkflowRuntimeBuilder() { this.builder = new DurableTaskGrpcWorkerBuilder().grpcChannel(NetworkUtils.buildGrpcManagedChannel()); @@ -38,6 +47,8 @@ public WorkflowRuntime build() { } } } + LOGGER.info("List of registered workflows: " + workflow_Set); + LOGGER.info("List of registered activites: " + activity_Set); return instance; } @@ -52,7 +63,7 @@ public WorkflowRuntimeBuilder registerWorkflow(Class cla this.builder = this.builder.addOrchestration( new OrchestratorWrapper<>(clazz) ); - + WorkflowRuntimeBuilder.workflow_Set.add(clazz.getCanonicalName()); return this; } @@ -66,5 +77,6 @@ public void registerActivity(Class clazz) { this.builder = this.builder.addActivity( new ActivityWrapper<>(clazz) ); + WorkflowRuntimeBuilder.activity_Set.add(clazz.getCanonicalName()); } }