diff --git a/connector-runtime/connector-runtime-spring/src/main/java/io/camunda/connector/runtime/inbound/importer/ProcessDefinitionImporter.java b/connector-runtime/connector-runtime-spring/src/main/java/io/camunda/connector/runtime/inbound/importer/ProcessDefinitionImporter.java index 56482f7036..0be7a367f4 100644 --- a/connector-runtime/connector-runtime-spring/src/main/java/io/camunda/connector/runtime/inbound/importer/ProcessDefinitionImporter.java +++ b/connector-runtime/connector-runtime-spring/src/main/java/io/camunda/connector/runtime/inbound/importer/ProcessDefinitionImporter.java @@ -65,6 +65,7 @@ public void handleImportedDefinitions(List definitions) { if (definitions.isEmpty()) { return; } + LOG.debug("Handle of the imported process definitions starts..."); try { meter(definitions.size()); var result = @@ -78,6 +79,7 @@ public void handleImportedDefinitions(List definitions) { definition -> new ProcessDefinitionVersion( definition.getKey(), definition.getVersion().intValue())))); + LOG.info("Updating the store with retrieved process definitions"); stateStore.update(result); } catch (Exception e) { LOG.error("Failed to handle imported definitions", e); diff --git a/connector-runtime/connector-runtime-spring/src/main/java/io/camunda/connector/runtime/inbound/importer/ProcessDefinitionSearch.java b/connector-runtime/connector-runtime-spring/src/main/java/io/camunda/connector/runtime/inbound/importer/ProcessDefinitionSearch.java index 52bc24732c..9c1fcb9f7e 100644 --- a/connector-runtime/connector-runtime-spring/src/main/java/io/camunda/connector/runtime/inbound/importer/ProcessDefinitionSearch.java +++ b/connector-runtime/connector-runtime-spring/src/main/java/io/camunda/connector/runtime/inbound/importer/ProcessDefinitionSearch.java @@ -75,6 +75,8 @@ public List query() { } List newPaginationIdx = processDefinitionResult.getSortValues(); + LOG.debug("A page of process definitions has been fetched, continuing..."); + if (!CollectionUtils.isEmpty(newPaginationIdx)) { paginationIndex = newPaginationIdx; } @@ -82,6 +84,7 @@ public List query() { // result is sorted by key in descending order, so we will always encounter the latest // version first + LOG.debug("Sorting process definition results by descending order"); var items = Optional.ofNullable(processDefinitionResult.getItems()).orElse(List.of()).stream() .filter( @@ -93,7 +96,7 @@ public List query() { } while (processDefinitionResult.getItems() != null && !processDefinitionResult.getItems().isEmpty()); - + LOG.debug("Fetching from Operate has been correctly executed."); return processDefinitions; } } diff --git a/connector-runtime/connector-runtime-spring/src/main/java/io/camunda/connector/runtime/inbound/state/ProcessStateStoreImpl.java b/connector-runtime/connector-runtime-spring/src/main/java/io/camunda/connector/runtime/inbound/state/ProcessStateStoreImpl.java index 34d933d34e..af45e6b556 100644 --- a/connector-runtime/connector-runtime-spring/src/main/java/io/camunda/connector/runtime/inbound/state/ProcessStateStoreImpl.java +++ b/connector-runtime/connector-runtime-spring/src/main/java/io/camunda/connector/runtime/inbound/state/ProcessStateStoreImpl.java @@ -37,12 +37,6 @@ public class ProcessStateStoreImpl implements ProcessStateStore { private final ProcessDefinitionInspector processDefinitionInspector; private final InboundExecutableRegistry executableRegistry; - private record ProcessState( - int version, - long processDefinitionKey, - String tenantId, - List connectorElements) {} - public ProcessStateStoreImpl( ProcessDefinitionInspector processDefinitionInspector, InboundExecutableRegistry executableRegistry) { @@ -54,11 +48,13 @@ public ProcessStateStoreImpl( public void update(ProcessImportResult processDefinitions) { var entries = processDefinitions.processDefinitionVersions().entrySet(); + LOG.debug("Filtering only new process definitions..."); var newlyDeployed = entries.stream() .filter(entry -> !processStates.containsKey(entry.getKey().bpmnProcessId())) .toList(); + LOG.debug("Filtering only updated process definitions..."); var replacedWithDifferentVersion = entries.stream() .filter( @@ -68,6 +64,7 @@ public void update(ProcessImportResult processDefinitions) { }) .toList(); + LOG.debug("Filtering only old process definitions)"); var deletedProcessIds = processStates.keySet().stream() .filter( @@ -85,6 +82,7 @@ public void update(ProcessImportResult processDefinitions) { private void newlyDeployed( Map.Entry entry) { + LOG.info("Activating newly deployed process definition: {}", entry.getKey().bpmnProcessId()); try { processStates.compute( entry.getKey().bpmnProcessId(), @@ -110,6 +108,9 @@ private void newlyDeployed( private void replacedWithDifferentVersion( Map.Entry entry) { try { + LOG.info( + "Activating newest deployed version process definition: {}", + entry.getKey().bpmnProcessId()); processStates.computeIfPresent( entry.getKey().bpmnProcessId(), (key, state) -> { @@ -133,6 +134,7 @@ private void replacedWithDifferentVersion( private void deleted(String processId) { try { + LOG.info("Deactivating newly deployed process definition: {}", processId); processStates.computeIfPresent( processId, (key1, state) -> { @@ -204,4 +206,10 @@ private void logResult( LOG.info(". . Process {}", key); } } + + private record ProcessState( + int version, + long processDefinitionKey, + String tenantId, + List connectorElements) {} }