From 59397697f3df696f310513d1f483cea6eafad586 Mon Sep 17 00:00:00 2001 From: Miklas Boskamp Date: Wed, 20 Dec 2023 14:49:21 +0100 Subject: [PATCH] feat(engine): Introduce operation log for sync message correlations Related to https://github.com/camunda/camunda-bpm-platform/issues/3900 --- .../engine/history/UserOperationLogEntry.java | 3 +- .../bpm/engine/impl/ProcessEngineLogger.java | 5 +- .../cfg/ProcessEngineConfigurationImpl.java | 30 ++ .../impl/cmd/AbstractCorrelateMessageCmd.java | 30 +- .../impl/cmd/CorrelateAllMessageCmd.java | 62 ++- .../engine/impl/cmd/CorrelateMessageCmd.java | 1 - .../SynchronousOperationLogProducer.java | 105 +++++ .../UserOperationLogEntryEventEntity.java | 33 +- .../{ => message}/MessageCorrelationTest.java | 119 +++-- ...essageCorrelationUserOperationLogTest.java | 445 ++++++++++++++++++ ...serOperationLogLimitConfigurationTest.java | 114 +++++ ...relationTest.sendMessageProcess.bpmn20.xml | 0 ...CatchingMessageEventCorrelation.bpmn20.xml | 0 ....testCorrelateAllWithoutMessage.bpmn20.xml | 0 ...tMatchingStartEventAndExecution.bpmn20.xml | 0 ...estMessageStartEventCorrelation.bpmn20.xml | 0 ...leMessageStartEventsCorrelation.bpmn20.xml | 0 ...ationTest.waitForMessageProcess.bpmn20.xml | 0 ...ationLogTest.intermediateMessageEvent.bpmn | 40 ++ ...serOperationLogTest.messageStartEvent.bpmn | 28 ++ ....shouldAllowToConfigureNegativeOne.cfg.xml | 27 ++ ...houldAllowToConfigurePositiveValue.cfg.xml | 27 ++ ...ptionWhenConfigureLowNegativeValue.cfg.xml | 27 ++ ...uldThrowExceptionWhenConfigureZero.cfg.xml | 27 ++ 24 files changed, 1030 insertions(+), 93 deletions(-) create mode 100644 engine/src/main/java/org/camunda/bpm/engine/impl/history/SynchronousOperationLogProducer.java rename engine/src/test/java/org/camunda/bpm/engine/test/api/runtime/{ => message}/MessageCorrelationTest.java (95%) create mode 100644 engine/src/test/java/org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationUserOperationLogTest.java create mode 100644 engine/src/test/java/org/camunda/bpm/engine/test/history/useroperationlog/SyncApiUserOperationLogLimitConfigurationTest.java rename engine/src/test/resources/org/camunda/bpm/engine/test/api/runtime/{ => message}/MessageCorrelationTest.sendMessageProcess.bpmn20.xml (100%) rename engine/src/test/resources/org/camunda/bpm/engine/test/api/runtime/{ => message}/MessageCorrelationTest.testCatchingMessageEventCorrelation.bpmn20.xml (100%) rename engine/src/test/resources/org/camunda/bpm/engine/test/api/runtime/{ => message}/MessageCorrelationTest.testCorrelateAllWithoutMessage.bpmn20.xml (100%) rename engine/src/test/resources/org/camunda/bpm/engine/test/api/runtime/{ => message}/MessageCorrelationTest.testMatchingStartEventAndExecution.bpmn20.xml (100%) rename engine/src/test/resources/org/camunda/bpm/engine/test/api/runtime/{ => message}/MessageCorrelationTest.testMessageStartEventCorrelation.bpmn20.xml (100%) rename engine/src/test/resources/org/camunda/bpm/engine/test/api/runtime/{ => message}/MessageCorrelationTest.testMultipleMessageStartEventsCorrelation.bpmn20.xml (100%) rename engine/src/test/resources/org/camunda/bpm/engine/test/api/runtime/{ => message}/MessageCorrelationTest.waitForMessageProcess.bpmn20.xml (100%) create mode 100644 engine/src/test/resources/org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationUserOperationLogTest.intermediateMessageEvent.bpmn create mode 100644 engine/src/test/resources/org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationUserOperationLogTest.messageStartEvent.bpmn create mode 100644 engine/src/test/resources/org/camunda/bpm/engine/test/history/useroperationlog/SyncApiUserOperationLogLimitConfigurationTest.shouldAllowToConfigureNegativeOne.cfg.xml create mode 100644 engine/src/test/resources/org/camunda/bpm/engine/test/history/useroperationlog/SyncApiUserOperationLogLimitConfigurationTest.shouldAllowToConfigurePositiveValue.cfg.xml create mode 100644 engine/src/test/resources/org/camunda/bpm/engine/test/history/useroperationlog/SyncApiUserOperationLogLimitConfigurationTest.shouldThrowExceptionWhenConfigureLowNegativeValue.cfg.xml create mode 100644 engine/src/test/resources/org/camunda/bpm/engine/test/history/useroperationlog/SyncApiUserOperationLogLimitConfigurationTest.shouldThrowExceptionWhenConfigureZero.cfg.xml diff --git a/engine/src/main/java/org/camunda/bpm/engine/history/UserOperationLogEntry.java b/engine/src/main/java/org/camunda/bpm/engine/history/UserOperationLogEntry.java index 502be385211..920c7227ad4 100644 --- a/engine/src/main/java/org/camunda/bpm/engine/history/UserOperationLogEntry.java +++ b/engine/src/main/java/org/camunda/bpm/engine/history/UserOperationLogEntry.java @@ -16,9 +16,8 @@ */ package org.camunda.bpm.engine.history; -import org.camunda.bpm.engine.EntityTypes; - import java.util.Date; +import org.camunda.bpm.engine.EntityTypes; /** diff --git a/engine/src/main/java/org/camunda/bpm/engine/impl/ProcessEngineLogger.java b/engine/src/main/java/org/camunda/bpm/engine/impl/ProcessEngineLogger.java index 97db3105c9b..72c78f94116 100644 --- a/engine/src/main/java/org/camunda/bpm/engine/impl/ProcessEngineLogger.java +++ b/engine/src/main/java/org/camunda/bpm/engine/impl/ProcessEngineLogger.java @@ -17,7 +17,6 @@ package org.camunda.bpm.engine.impl; import java.net.URL; - import org.camunda.bpm.application.impl.ProcessApplicationLogger; import org.camunda.bpm.container.impl.ContainerIntegrationLogger; import org.camunda.bpm.engine.ProcessEngineConfiguration; @@ -126,10 +125,10 @@ public class ProcessEngineLogger extends BaseLogger { MigrationLogger.class, PROJECT_CODE, "org.camunda.bpm.engine.migration", "23"); public static final ExternalTaskLogger EXTERNAL_TASK_LOGGER = BaseLogger.createLogger( - ExternalTaskLogger.class, PROJECT_CODE, "org.camunda.bpm.engine.externaltask", "24"); + ExternalTaskLogger.class, PROJECT_CODE, "org.camunda.bpm.engine.externaltask", "24"); public static final SecurityLogger SECURITY_LOGGER = BaseLogger.createLogger( - SecurityLogger.class, PROJECT_CODE, "org.camunda.bpm.engine.security", "25"); + SecurityLogger.class, PROJECT_CODE, "org.camunda.bpm.engine.security", "25"); public static final IncidentLogger INCIDENT_LOGGER = BaseLogger.createLogger( IncidentLogger.class, PROJECT_CODE, "org.camunda.bpm.engine.incident", "26"); diff --git a/engine/src/main/java/org/camunda/bpm/engine/impl/cfg/ProcessEngineConfigurationImpl.java b/engine/src/main/java/org/camunda/bpm/engine/impl/cfg/ProcessEngineConfigurationImpl.java index 7018ef108f7..993a5aaa86b 100644 --- a/engine/src/main/java/org/camunda/bpm/engine/impl/cfg/ProcessEngineConfigurationImpl.java +++ b/engine/src/main/java/org/camunda/bpm/engine/impl/cfg/ProcessEngineConfigurationImpl.java @@ -853,6 +853,18 @@ public abstract class ProcessEngineConfigurationImpl extends ProcessEngineConfig */ protected boolean restrictUserOperationLogToAuthenticatedUsers = true; + /** + * Maximum number of operation log entries written per synchronous operation. + * APIs that can affect multiple entities can produce an operation log entry each. + * This property controls how the operation logs are handled. Possible values: + * + */ + protected long logEntriesPerSyncOperationLimit = 1L; + protected boolean disableStrictCallActivityValidation = false; protected boolean isBpmnStacktraceVerbose = false; @@ -1194,6 +1206,7 @@ protected void init() { initAdminUser(); initAdminGroups(); initPasswordPolicy(); + initOperationLog(); invokePostInit(); } @@ -2852,6 +2865,14 @@ protected void initDeploymentRegistration() { } } + protected void initOperationLog() { + if(logEntriesPerSyncOperationLimit < -1 || logEntriesPerSyncOperationLimit == 0) { + throw new ProcessEngineException( + "Invalid configuration for logEntriesPerSyncOperationLimit. Configured value needs to be either -1 or greater than 0 but was " + + logEntriesPerSyncOperationLimit + "."); + } + } + // cache factory ////////////////////////////////////////////////////////// protected void initCacheFactory() { @@ -4593,6 +4614,15 @@ public ProcessEngineConfigurationImpl setRestrictUserOperationLogToAuthenticated return this; } + public long getLogEntriesPerSyncOperationLimit() { + return logEntriesPerSyncOperationLimit; + } + + public ProcessEngineConfigurationImpl setLogEntriesPerSyncOperationLimit(long logEntriesPerSyncOperationLimit) { + this.logEntriesPerSyncOperationLimit = logEntriesPerSyncOperationLimit; + return this; + } + public ProcessEngineConfigurationImpl setTenantIdProvider(TenantIdProvider tenantIdProvider) { this.tenantIdProvider = tenantIdProvider; return this; diff --git a/engine/src/main/java/org/camunda/bpm/engine/impl/cmd/AbstractCorrelateMessageCmd.java b/engine/src/main/java/org/camunda/bpm/engine/impl/cmd/AbstractCorrelateMessageCmd.java index 2c32c8fb566..ae1a42c0261 100644 --- a/engine/src/main/java/org/camunda/bpm/engine/impl/cmd/AbstractCorrelateMessageCmd.java +++ b/engine/src/main/java/org/camunda/bpm/engine/impl/cmd/AbstractCorrelateMessageCmd.java @@ -44,7 +44,8 @@ public abstract class AbstractCorrelateMessageCmd { protected final MessageCorrelationBuilderImpl builder; protected ExecutionVariableSnapshotObserver variablesListener; - protected boolean variablesEnabled = false; + protected boolean variablesInResultEnabled = false; + protected long variablesCount = 0; protected boolean deserializeVariableValues = false; /** @@ -55,11 +56,13 @@ public abstract class AbstractCorrelateMessageCmd { protected AbstractCorrelateMessageCmd(MessageCorrelationBuilderImpl builder) { this.builder = builder; this.messageName = builder.getMessageName(); + countVariables(); + } protected AbstractCorrelateMessageCmd(MessageCorrelationBuilderImpl builder, boolean variablesEnabled, boolean deserializeVariableValues) { this(builder); - this.variablesEnabled = variablesEnabled; + this.variablesInResultEnabled = variablesEnabled; this.deserializeVariableValues = deserializeVariableValues; } @@ -81,11 +84,11 @@ protected ProcessInstance instantiateProcess(CommandContext commandContext, Corr ActivityImpl messageStartEvent = processDefinitionEntity.findActivity(correlationResult.getStartEventActivityId()); ExecutionEntity processInstance = processDefinitionEntity.createProcessInstance(builder.getBusinessKey(), messageStartEvent); - if (variablesEnabled) { + if (variablesInResultEnabled) { variablesListener = new ExecutionVariableSnapshotObserver(processInstance, false, deserializeVariableValues); } - VariableMap startVariables = resolveStartVariables(); + VariableMap startVariables = resolveVariables(); processInstance.start(startVariables); @@ -112,7 +115,11 @@ protected MessageCorrelationResultImpl createMessageCorrelationResult(final Comm MessageCorrelationResultImpl resultWithVariables = new MessageCorrelationResultImpl(handlerResult); if (MessageCorrelationResultType.Execution.equals(handlerResult.getResultType())) { ExecutionEntity execution = findProcessInstanceExecution(commandContext, handlerResult); - if (variablesEnabled && execution != null) { + + ProcessInstance processInstance = execution.getProcessInstance(); + resultWithVariables.setProcessInstance(processInstance); + + if (variablesInResultEnabled && execution != null) { variablesListener = new ExecutionVariableSnapshotObserver(execution, false, deserializeVariableValues); } triggerExecution(commandContext, handlerResult); @@ -133,7 +140,7 @@ protected ExecutionEntity findProcessInstanceExecution(final CommandContext comm return execution; } - protected VariableMap resolveStartVariables() { + protected VariableMap resolveVariables() { VariableMap mergedVariables = Variables.createVariables(); mergedVariables.putAll(builder.getPayloadProcessInstanceVariables()); mergedVariables.putAll(builder.getPayloadProcessInstanceVariablesLocal()); @@ -141,4 +148,15 @@ protected VariableMap resolveStartVariables() { return mergedVariables; } + protected void countVariables() { + if(builder.getPayloadProcessInstanceVariables() != null) { + variablesCount += builder.getPayloadProcessInstanceVariables().size(); + } + if(builder.getPayloadProcessInstanceVariablesLocal() != null) { + variablesCount += builder.getPayloadProcessInstanceVariablesLocal().size(); + } + if(builder.getPayloadProcessInstanceVariablesToTriggeredScope() != null) { + variablesCount += builder.getPayloadProcessInstanceVariablesToTriggeredScope().size(); + } + } } diff --git a/engine/src/main/java/org/camunda/bpm/engine/impl/cmd/CorrelateAllMessageCmd.java b/engine/src/main/java/org/camunda/bpm/engine/impl/cmd/CorrelateAllMessageCmd.java index a4b528dbe9c..ac3f117f8f3 100644 --- a/engine/src/main/java/org/camunda/bpm/engine/impl/cmd/CorrelateAllMessageCmd.java +++ b/engine/src/main/java/org/camunda/bpm/engine/impl/cmd/CorrelateAllMessageCmd.java @@ -17,26 +17,32 @@ package org.camunda.bpm.engine.impl.cmd; +import static org.camunda.bpm.engine.impl.util.EnsureUtil.ensureAtLeastOneNotNull; + import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.concurrent.Callable; - +import org.camunda.bpm.engine.history.UserOperationLogEntry; import org.camunda.bpm.engine.impl.MessageCorrelationBuilderImpl; import org.camunda.bpm.engine.impl.context.Context; +import org.camunda.bpm.engine.impl.history.SynchronousOperationLogProducer; import org.camunda.bpm.engine.impl.interceptor.Command; import org.camunda.bpm.engine.impl.interceptor.CommandContext; +import org.camunda.bpm.engine.impl.persistence.entity.PropertyChange; import org.camunda.bpm.engine.impl.runtime.CorrelationHandler; +import org.camunda.bpm.engine.impl.runtime.CorrelationHandlerResult; import org.camunda.bpm.engine.impl.runtime.CorrelationSet; import org.camunda.bpm.engine.impl.runtime.MessageCorrelationResultImpl; -import org.camunda.bpm.engine.impl.runtime.CorrelationHandlerResult; -import static org.camunda.bpm.engine.impl.util.EnsureUtil.ensureAtLeastOneNotNull; +import org.camunda.bpm.engine.runtime.ProcessInstance; /** * @author Thorben Lindhauer * @author Daniel Meyer * @author Michael Scholz */ -public class CorrelateAllMessageCmd extends AbstractCorrelateMessageCmd implements Command> { +public class CorrelateAllMessageCmd extends AbstractCorrelateMessageCmd implements Command>, SynchronousOperationLogProducer { /** * Initialize the command with a builder @@ -70,6 +76,54 @@ public List call() throws Exception { results.add(createMessageCorrelationResult(commandContext, correlationResult)); } + produceOperationLog(commandContext, results); + return results; } + + @Override + public void createOperationLogEntry(CommandContext commandContext, MessageCorrelationResultImpl result, List propChanges, boolean isSummary) { + String processInstanceId = null; + String processDefinitionId = null; + if(result.getProcessInstance() != null) { + if(!isSummary) { + processInstanceId = result.getProcessInstance().getId(); + } + processDefinitionId = result.getProcessInstance().getProcessDefinitionId(); + } + commandContext.getOperationLogManager() + .logProcessInstanceOperation(UserOperationLogEntry.OPERATION_TYPE_CORRELATE_MESSAGE, processInstanceId, processDefinitionId, null, propChanges); + } + + @Override + public Map> getPropChangesForOperation(List results) { + Map> resultPropChanges = new HashMap<>(); + for (MessageCorrelationResultImpl messageCorrelationResultImpl : results) { + List propChanges = getGenericPropChangesForOperation(); + ProcessInstance processInstance = messageCorrelationResultImpl.getProcessInstance(); + if(processInstance != null) { + propChanges.add(new PropertyChange("processInstanceId", null, processInstance.getId())); + } + resultPropChanges.put(messageCorrelationResultImpl, propChanges); + } + return resultPropChanges; + } + + @Override + public List getSummarizingPropChangesForOperation(List results) { + List propChanges = getGenericPropChangesForOperation(); + propChanges.add(new PropertyChange("nrOfInstances", null, results.size())); + return propChanges; + } + + protected List getGenericPropChangesForOperation() { + ArrayList propChanges = new ArrayList<>(); + + propChanges.add(new PropertyChange("messageName", null, messageName)); + if(variablesCount > 0) { + propChanges.add(new PropertyChange("nrOfVariables", null, variablesCount)); + } + + return propChanges; + } } diff --git a/engine/src/main/java/org/camunda/bpm/engine/impl/cmd/CorrelateMessageCmd.java b/engine/src/main/java/org/camunda/bpm/engine/impl/cmd/CorrelateMessageCmd.java index d73a18f0a2f..0a96f54e769 100644 --- a/engine/src/main/java/org/camunda/bpm/engine/impl/cmd/CorrelateMessageCmd.java +++ b/engine/src/main/java/org/camunda/bpm/engine/impl/cmd/CorrelateMessageCmd.java @@ -21,7 +21,6 @@ import java.util.List; import java.util.concurrent.Callable; - import org.camunda.bpm.engine.MismatchingMessageCorrelationException; import org.camunda.bpm.engine.impl.MessageCorrelationBuilderImpl; import org.camunda.bpm.engine.impl.ProcessEngineLogger; diff --git a/engine/src/main/java/org/camunda/bpm/engine/impl/history/SynchronousOperationLogProducer.java b/engine/src/main/java/org/camunda/bpm/engine/impl/history/SynchronousOperationLogProducer.java new file mode 100644 index 00000000000..76cc41146bf --- /dev/null +++ b/engine/src/main/java/org/camunda/bpm/engine/impl/history/SynchronousOperationLogProducer.java @@ -0,0 +1,105 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.engine.impl.history; + +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.function.Function; +import java.util.stream.Collectors; +import org.camunda.bpm.engine.ProcessEngineException; +import org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl; +import org.camunda.bpm.engine.impl.interceptor.CommandContext; +import org.camunda.bpm.engine.impl.persistence.entity.PropertyChange; + +/** + * Interface for Commands that synchronously modify multiple entities in one operation. + * The methods of this interface take care of producing operation log entries based on the + * {@link ProcessEngineConfigurationImpl#getLogEntriesPerSyncOperationLimit() logEntriesPerSyncOperationLimit} property. + */ +public interface SynchronousOperationLogProducer { + + Long SUMMARY_LOG = 1L; + Long UNLIMITED_LOG = -1L; + + /** + * Returns a map containing a list of changed properties for every result of the operation. + * Used to produce an operation log entry per entry contained in the returned map. + */ + Map> getPropChangesForOperation(List results); + + /** + * Returns a list of changed properties summarizing the whole operation involving multiple entities. + */ + List getSummarizingPropChangesForOperation(List results); + + /** + * Calls the code that produces the operation log. Usually commandContext.getOperationLogManager().log... + * + * The implementation must be capable of producing a single, summarizing operation log that contain information about an operation + * spanning affecting multiple entities as well as producing a single, detailed operation log containing information about a single + * affected entity. This method is called by the {@link SynchronousOperationLogProducer#produceOperationLog(CommandContext, List) produceOperationLog} + * method. + * + * @param commandContext the current command context + * @param result An object resulting from the operation for which this method produces the operation log. In case the operation produced + * multiple objects, depending on the implementation a representative object from the list of results or null can be passed. + * @param propChanges property changes to be attached to the operation log + * @param isSummary indicates whether the implementation should produce a summary log or a detailed log + */ + void createOperationLogEntry(CommandContext commandContext, T result, List propChanges, boolean isSummary); + + /** + * The implementing command can call this method to produce the operation log entries for the current operation. + */ + default void produceOperationLog(CommandContext commandContext, List results) { + if(results == null || results.isEmpty()) { + return; + } + + long logEntriesPerSyncOperationLimit = commandContext.getProcessEngineConfiguration() + .getLogEntriesPerSyncOperationLimit(); + if(logEntriesPerSyncOperationLimit == SUMMARY_LOG && results.size() > 1) { + // create summary from multi-result operation + List propChangesForOperation = getSummarizingPropChangesForOperation(results); + if(propChangesForOperation == null) { + // convert null return value to empty list + propChangesForOperation = Collections.singletonList(PropertyChange.EMPTY_CHANGE); + } + // use first result as representative for summarized operation log entry + createOperationLogEntry(commandContext, results.get(0), propChangesForOperation, true); + } else { + // create detailed log for each operation result + Map> propChangesForOperation = getPropChangesForOperation(results); + if(propChangesForOperation == null ) { + // create a map with empty result lists for each result item + propChangesForOperation = results.stream().collect(Collectors.toMap(Function.identity(), (result) -> Collections.singletonList(PropertyChange.EMPTY_CHANGE))); + } + if (logEntriesPerSyncOperationLimit != UNLIMITED_LOG && logEntriesPerSyncOperationLimit < propChangesForOperation.size()) { + throw new ProcessEngineException( + "Maximum number of operation log entries for operation type synchronous APIs reached. Configured limit is " + + logEntriesPerSyncOperationLimit + " but " + propChangesForOperation.size() + " entities were affected by API call."); + } else { + // produce one operation log per affected entity + for (Entry> propChanges : propChangesForOperation.entrySet()) { + createOperationLogEntry(commandContext, propChanges.getKey(), propChanges.getValue(), false); + } + } + } + } +} diff --git a/engine/src/main/java/org/camunda/bpm/engine/impl/history/event/UserOperationLogEntryEventEntity.java b/engine/src/main/java/org/camunda/bpm/engine/impl/history/event/UserOperationLogEntryEventEntity.java index 746bfddbe14..1ec16753fbf 100644 --- a/engine/src/main/java/org/camunda/bpm/engine/impl/history/event/UserOperationLogEntryEventEntity.java +++ b/engine/src/main/java/org/camunda/bpm/engine/impl/history/event/UserOperationLogEntryEventEntity.java @@ -17,7 +17,6 @@ package org.camunda.bpm.engine.impl.history.event; import java.util.Date; - import org.camunda.bpm.engine.history.UserOperationLogEntry; /** @@ -156,7 +155,7 @@ public String getBatchId() { public void setBatchId(String batchId) { this.batchId = batchId; } - + public String getCategory() { return category; } @@ -172,11 +171,11 @@ public String getRootProcessInstanceId() { public void setRootProcessInstanceId(String rootProcessInstanceId) { this.rootProcessInstanceId = rootProcessInstanceId; } - + public String getExternalTaskId() { return externalTaskId; } - + public void setExternalTaskId(String externalTaskId) { this.externalTaskId = externalTaskId; } @@ -192,19 +191,19 @@ public void setAnnotation(String annotation) { @Override public String toString() { return this.getClass().getSimpleName() - + "[taskId" + taskId - + ", deploymentId" + deploymentId - + ", processDefinitionKey =" + processDefinitionKey - + ", jobId = " + jobId - + ", jobDefinitionId = " + jobDefinitionId - + ", batchId = " + batchId - + ", operationId =" + operationId - + ", operationType =" + operationType - + ", userId =" + userId - + ", timestamp =" + timestamp - + ", property =" + property - + ", orgValue =" + orgValue - + ", newValue =" + newValue + + "[taskId=" + taskId + + ", deploymentId=" + deploymentId + + ", processDefinitionKey=" + processDefinitionKey + + ", jobId=" + jobId + + ", jobDefinitionId=" + jobDefinitionId + + ", batchId=" + batchId + + ", operationId=" + operationId + + ", operationType=" + operationType + + ", userId=" + userId + + ", timestamp=" + timestamp + + ", property=" + property + + ", orgValue=" + orgValue + + ", newValue=" + newValue + ", id=" + id + ", eventType=" + eventType + ", executionId=" + executionId diff --git a/engine/src/test/java/org/camunda/bpm/engine/test/api/runtime/MessageCorrelationTest.java b/engine/src/test/java/org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationTest.java similarity index 95% rename from engine/src/test/java/org/camunda/bpm/engine/test/api/runtime/MessageCorrelationTest.java rename to engine/src/test/java/org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationTest.java index 4e8ad400472..c5c3c76a518 100644 --- a/engine/src/test/java/org/camunda/bpm/engine/test/api/runtime/MessageCorrelationTest.java +++ b/engine/src/test/java/org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationTest.java @@ -14,10 +14,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.camunda.bpm.engine.test.api.runtime; -import static org.camunda.bpm.engine.test.api.runtime.migration.ModifiableBpmnModelInstance.modify; +package org.camunda.bpm.engine.test.api.runtime.message; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; +import static org.camunda.bpm.engine.test.api.runtime.migration.ModifiableBpmnModelInstance.modify; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; @@ -33,7 +33,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; - import org.camunda.bpm.engine.BadUserRequestException; import org.camunda.bpm.engine.HistoryService; import org.camunda.bpm.engine.MismatchingMessageCorrelationException; @@ -164,7 +163,7 @@ public void testCatchingMessageEventCorrelation() { } - @Deployment(resources = "org/camunda/bpm/engine/test/api/runtime/MessageCorrelationTest.testCatchingMessageEventCorrelation.bpmn20.xml") + @Deployment(resources = "org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationTest.testCatchingMessageEventCorrelation.bpmn20.xml") @Test public void testOneMatchinProcessInstanceUsingFluentCorrelateAll() { Map variables = new HashMap<>(); @@ -200,7 +199,7 @@ public void testOneMatchinProcessInstanceUsingFluentCorrelateAll() { assertEquals(1, correlatedExecutions); } - @Deployment(resources = "org/camunda/bpm/engine/test/api/runtime/MessageCorrelationTest.testCatchingMessageEventCorrelation.bpmn20.xml") + @Deployment(resources = "org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationTest.testCatchingMessageEventCorrelation.bpmn20.xml") @Test public void testTwoMatchingProcessInstancesCorrelation() { Map variables = new HashMap<>(); @@ -233,7 +232,7 @@ public void testTwoMatchingProcessInstancesCorrelation() { } } - @Deployment(resources = "org/camunda/bpm/engine/test/api/runtime/MessageCorrelationTest.testCatchingMessageEventCorrelation.bpmn20.xml") + @Deployment(resources = "org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationTest.testCatchingMessageEventCorrelation.bpmn20.xml") @Test public void testTwoMatchingProcessInstancesUsingFluentCorrelateAll() { Map variables = new HashMap<>(); @@ -270,7 +269,7 @@ public void testTwoMatchingProcessInstancesUsingFluentCorrelateAll() { } - @Deployment(resources = "org/camunda/bpm/engine/test/api/runtime/MessageCorrelationTest.testCatchingMessageEventCorrelation.bpmn20.xml") + @Deployment(resources = "org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationTest.testCatchingMessageEventCorrelation.bpmn20.xml") @Test public void testExecutionCorrelationByBusinessKey() { String businessKey = "aBusinessKey"; @@ -297,7 +296,7 @@ public void testExecutionCorrelationByBusinessKey() { runtimeService.deleteProcessInstance(processInstance.getId(), null); } - @Deployment(resources = "org/camunda/bpm/engine/test/api/runtime/MessageCorrelationTest.testCatchingMessageEventCorrelation.bpmn20.xml") + @Deployment(resources = "org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationTest.testCatchingMessageEventCorrelation.bpmn20.xml") @Test public void testExecutionCorrelationByBusinessKeyUsingFluentCorrelateAll() { String businessKey = "aBusinessKey"; @@ -315,7 +314,7 @@ public void testExecutionCorrelationByBusinessKeyUsingFluentCorrelateAll() { } - @Deployment(resources = "org/camunda/bpm/engine/test/api/runtime/MessageCorrelationTest.testCatchingMessageEventCorrelation.bpmn20.xml") + @Deployment(resources = "org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationTest.testCatchingMessageEventCorrelation.bpmn20.xml") @Test public void testMessageCorrelateAllResultListWithResultTypeExecution() { //given @@ -340,7 +339,7 @@ public void testMessageCorrelateAllResultListWithResultTypeExecution() { } - @Deployment(resources = "org/camunda/bpm/engine/test/api/runtime/MessageCorrelationTest.testMessageStartEventCorrelation.bpmn20.xml") + @Deployment(resources = "org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationTest.testMessageStartEventCorrelation.bpmn20.xml") @Test public void testMessageCorrelateAllResultListWithResultTypeProcessDefinition() { //when correlated all with result @@ -355,7 +354,7 @@ public void testMessageCorrelateAllResultListWithResultTypeProcessDefinition() { } - @Deployment(resources = "org/camunda/bpm/engine/test/api/runtime/MessageCorrelationTest.testCatchingMessageEventCorrelation.bpmn20.xml") + @Deployment(resources = "org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationTest.testCatchingMessageEventCorrelation.bpmn20.xml") @Test public void testExecutionCorrelationByBusinessKeyWithVariables() { String businessKey = "aBusinessKey"; @@ -389,7 +388,7 @@ public void testExecutionCorrelationByBusinessKeyWithVariables() { runtimeService.deleteProcessInstance(processInstance.getId(), null); } - @Deployment(resources = "org/camunda/bpm/engine/test/api/runtime/MessageCorrelationTest.testCatchingMessageEventCorrelation.bpmn20.xml") + @Deployment(resources = "org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationTest.testCatchingMessageEventCorrelation.bpmn20.xml") @Test public void testExecutionCorrelationByBusinessKeyWithVariablesUsingFluentCorrelateAll() { String businessKey = "aBusinessKey"; @@ -411,7 +410,7 @@ public void testExecutionCorrelationByBusinessKeyWithVariablesUsingFluentCorrela } - @Deployment(resources = "org/camunda/bpm/engine/test/api/runtime/MessageCorrelationTest.testCatchingMessageEventCorrelation.bpmn20.xml") + @Deployment(resources = "org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationTest.testCatchingMessageEventCorrelation.bpmn20.xml") @Test public void testExecutionCorrelationSetSerializedVariableValue() throws IOException, ClassNotFoundException { @@ -452,7 +451,7 @@ public void testExecutionCorrelationSetSerializedVariableValue() throws IOExcept assertEquals(SerializationDataFormats.JAVA.getName(), variableTyped.getSerializationDataFormat()); } - @Deployment(resources = "org/camunda/bpm/engine/test/api/runtime/MessageCorrelationTest.testCatchingMessageEventCorrelation.bpmn20.xml") + @Deployment(resources = "org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationTest.testCatchingMessageEventCorrelation.bpmn20.xml") @Test public void testExecutionCorrelationSetSerializedVariableValues() throws IOException, ClassNotFoundException { @@ -507,7 +506,7 @@ public void testMessageStartEventCorrelation() { assertEquals(1, instances); } - @Deployment(resources = "org/camunda/bpm/engine/test/api/runtime/MessageCorrelationTest.testMessageStartEventCorrelation.bpmn20.xml") + @Deployment(resources = "org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationTest.testMessageStartEventCorrelation.bpmn20.xml") @Test public void testMessageStartEventCorrelationUsingFluentCorrelateStartMessage() { @@ -520,7 +519,7 @@ public void testMessageStartEventCorrelationUsingFluentCorrelateStartMessage() { assertEquals(1, instances); } - @Deployment(resources = "org/camunda/bpm/engine/test/api/runtime/MessageCorrelationTest.testMessageStartEventCorrelation.bpmn20.xml") + @Deployment(resources = "org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationTest.testMessageStartEventCorrelation.bpmn20.xml") @Test public void testMessageStartEventCorrelationUsingFluentCorrelateSingle() { @@ -533,7 +532,7 @@ public void testMessageStartEventCorrelationUsingFluentCorrelateSingle() { assertEquals(1, instances); } - @Deployment(resources = "org/camunda/bpm/engine/test/api/runtime/MessageCorrelationTest.testMessageStartEventCorrelation.bpmn20.xml") + @Deployment(resources = "org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationTest.testMessageStartEventCorrelation.bpmn20.xml") @Test public void testMessageStartEventCorrelationUsingFluentCorrelateAll() { @@ -549,7 +548,7 @@ public void testMessageStartEventCorrelationUsingFluentCorrelateAll() { assertEquals(1, instances); } - @Deployment(resources={"org/camunda/bpm/engine/test/api/runtime/MessageCorrelationTest.testMessageStartEventCorrelation.bpmn20.xml"}) + @Deployment(resources={"org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationTest.testMessageStartEventCorrelation.bpmn20.xml"}) @Test public void testMessageStartEventCorrelationWithBusinessKey() { final String businessKey = "aBusinessKey"; @@ -561,7 +560,7 @@ public void testMessageStartEventCorrelationWithBusinessKey() { assertEquals(businessKey, processInstance.getBusinessKey()); } - @Deployment(resources={"org/camunda/bpm/engine/test/api/runtime/MessageCorrelationTest.testMessageStartEventCorrelation.bpmn20.xml"}) + @Deployment(resources={"org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationTest.testMessageStartEventCorrelation.bpmn20.xml"}) @Test public void testMessageStartEventCorrelationWithBusinessKeyUsingFluentCorrelateStartMessage() { final String businessKey = "aBusinessKey"; @@ -575,7 +574,7 @@ public void testMessageStartEventCorrelationWithBusinessKeyUsingFluentCorrelateS assertEquals(businessKey, processInstance.getBusinessKey()); } - @Deployment(resources={"org/camunda/bpm/engine/test/api/runtime/MessageCorrelationTest.testMessageStartEventCorrelation.bpmn20.xml"}) + @Deployment(resources={"org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationTest.testMessageStartEventCorrelation.bpmn20.xml"}) @Test public void testMessageStartEventCorrelationWithBusinessKeyUsingFluentCorrelateSingle() { final String businessKey = "aBusinessKey"; @@ -589,7 +588,7 @@ public void testMessageStartEventCorrelationWithBusinessKeyUsingFluentCorrelateS assertEquals(businessKey, processInstance.getBusinessKey()); } - @Deployment(resources={"org/camunda/bpm/engine/test/api/runtime/MessageCorrelationTest.testMessageStartEventCorrelation.bpmn20.xml"}) + @Deployment(resources={"org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationTest.testMessageStartEventCorrelation.bpmn20.xml"}) @Test public void testMessageStartEventCorrelationWithBusinessKeyUsingFluentCorrelateAll() { final String businessKey = "aBusinessKey"; @@ -603,7 +602,7 @@ public void testMessageStartEventCorrelationWithBusinessKeyUsingFluentCorrelateA assertEquals(businessKey, processInstance.getBusinessKey()); } - @Deployment(resources = "org/camunda/bpm/engine/test/api/runtime/MessageCorrelationTest.testMessageStartEventCorrelation.bpmn20.xml") + @Deployment(resources = "org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationTest.testMessageStartEventCorrelation.bpmn20.xml") @Test public void testMessageStartEventCorrelationSetSerializedVariableValue() throws IOException, ClassNotFoundException { @@ -644,7 +643,7 @@ public void testMessageStartEventCorrelationSetSerializedVariableValue() throws assertEquals(SerializationDataFormats.JAVA.getName(), variableTyped.getSerializationDataFormat()); } - @Deployment(resources = "org/camunda/bpm/engine/test/api/runtime/MessageCorrelationTest.testMessageStartEventCorrelation.bpmn20.xml") + @Deployment(resources = "org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationTest.testMessageStartEventCorrelation.bpmn20.xml") @Test public void testMessageStartEventCorrelationSetSerializedVariableValues() throws IOException, ClassNotFoundException { @@ -686,7 +685,7 @@ public void testMessageStartEventCorrelationSetSerializedVariableValues() throws assertEquals(SerializationDataFormats.JAVA.getName(), variableTyped.getSerializationDataFormat()); } - @Deployment(resources = "org/camunda/bpm/engine/test/api/runtime/MessageCorrelationTest.testMessageStartEventCorrelation.bpmn20.xml") + @Deployment(resources = "org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationTest.testMessageStartEventCorrelation.bpmn20.xml") @Test public void testMessageStartEventCorrelationWithVariablesUsingFluentCorrelateStartMessage() { @@ -702,7 +701,7 @@ public void testMessageStartEventCorrelationWithVariablesUsingFluentCorrelateSta assertEquals(1, query.count()); } - @Deployment(resources = "org/camunda/bpm/engine/test/api/runtime/MessageCorrelationTest.testMessageStartEventCorrelation.bpmn20.xml") + @Deployment(resources = "org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationTest.testMessageStartEventCorrelation.bpmn20.xml") @Test public void testMessageStartEventCorrelationWithVariablesUsingFluentCorrelateSingleMessage() { @@ -718,7 +717,7 @@ public void testMessageStartEventCorrelationWithVariablesUsingFluentCorrelateSin assertEquals(1, query.count()); } - @Deployment(resources = "org/camunda/bpm/engine/test/api/runtime/MessageCorrelationTest.testMessageStartEventCorrelation.bpmn20.xml") + @Deployment(resources = "org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationTest.testMessageStartEventCorrelation.bpmn20.xml") @Test public void testMessageStartEventCorrelationWithVariablesUsingFluentCorrelateAll() { @@ -756,7 +755,7 @@ public void testMultipleMessageStartEventsCorrelation() { taskService.complete(task.getId()); } - @Deployment(resources={"org/camunda/bpm/engine/test/api/runtime/MessageCorrelationTest.testMultipleMessageStartEventsCorrelation.bpmn20.xml"}) + @Deployment(resources={"org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationTest.testMultipleMessageStartEventsCorrelation.bpmn20.xml"}) @Test public void testMultipleMessageStartEventsCorrelationUsingFluentCorrelateStartMessage() { @@ -775,7 +774,7 @@ public void testMultipleMessageStartEventsCorrelationUsingFluentCorrelateStartMe taskService.complete(task.getId()); } - @Deployment(resources={"org/camunda/bpm/engine/test/api/runtime/MessageCorrelationTest.testMultipleMessageStartEventsCorrelation.bpmn20.xml"}) + @Deployment(resources={"org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationTest.testMultipleMessageStartEventsCorrelation.bpmn20.xml"}) @Test public void testMultipleMessageStartEventsCorrelationUsingFluentCorrelateSingle() { @@ -797,7 +796,7 @@ public void testMultipleMessageStartEventsCorrelationUsingFluentCorrelateSingle( /** * this test assures the right start event is selected */ - @Deployment(resources={"org/camunda/bpm/engine/test/api/runtime/MessageCorrelationTest.testMultipleMessageStartEventsCorrelation.bpmn20.xml"}) + @Deployment(resources={"org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationTest.testMultipleMessageStartEventsCorrelation.bpmn20.xml"}) @Test public void testMultipleMessageStartEventsCorrelationUsingFluentCorrelateAll() { @@ -842,7 +841,7 @@ public void testMatchingStartEventAndExecution() { } - @Deployment(resources={"org/camunda/bpm/engine/test/api/runtime/MessageCorrelationTest.testMatchingStartEventAndExecution.bpmn20.xml"}) + @Deployment(resources={"org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationTest.testMatchingStartEventAndExecution.bpmn20.xml"}) @Test public void testMessageCorrelationResultWithResultTypeProcessDefinition() { //given @@ -865,7 +864,7 @@ protected void checkProcessDefinitionMessageCorrelationResult(MessageCorrelation } - @Deployment(resources={"org/camunda/bpm/engine/test/api/runtime/MessageCorrelationTest.testMatchingStartEventAndExecution.bpmn20.xml"}) + @Deployment(resources={"org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationTest.testMatchingStartEventAndExecution.bpmn20.xml"}) @Test public void testMessageCorrelationResultWithResultTypeExecution() { //given @@ -891,7 +890,7 @@ protected void checkExecutionMessageCorrelationResult(MessageCorrelationResult r } - @Deployment(resources={"org/camunda/bpm/engine/test/api/runtime/MessageCorrelationTest.testMatchingStartEventAndExecution.bpmn20.xml"}) + @Deployment(resources={"org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationTest.testMatchingStartEventAndExecution.bpmn20.xml"}) @Test public void testMatchingStartEventAndExecutionUsingFluentCorrelateAll() { runtimeService.startProcessInstanceByKey("process"); @@ -906,7 +905,7 @@ public void testMatchingStartEventAndExecutionUsingFluentCorrelateAll() { } - @Deployment(resources={"org/camunda/bpm/engine/test/api/runtime/MessageCorrelationTest.testMatchingStartEventAndExecution.bpmn20.xml"}) + @Deployment(resources={"org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationTest.testMatchingStartEventAndExecution.bpmn20.xml"}) @Test public void testMatchingStartEventAndExecutionCorrelateAllWithResult() { //given @@ -964,7 +963,7 @@ public void testMessageStartEventCorrelationWithNonMatchingDefinition() { runtimeService.createMessageCorrelation("aMessageName").correlateAll(); } - @Deployment(resources = "org/camunda/bpm/engine/test/api/runtime/MessageCorrelationTest.testCatchingMessageEventCorrelation.bpmn20.xml") + @Deployment(resources = "org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationTest.testCatchingMessageEventCorrelation.bpmn20.xml") @Test public void testCorrelationByBusinessKeyAndVariables() { Map variables = new HashMap<>(); @@ -1023,7 +1022,7 @@ public void testCorrelationByBusinessKeyAndVariables() { } - @Deployment(resources = "org/camunda/bpm/engine/test/api/runtime/MessageCorrelationTest.testCatchingMessageEventCorrelation.bpmn20.xml") + @Deployment(resources = "org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationTest.testCatchingMessageEventCorrelation.bpmn20.xml") @Test public void testCorrelationByBusinessKeyAndVariablesUsingFluentCorrelateAll() { Map variables = new HashMap<>(); @@ -1065,7 +1064,7 @@ public void testCorrelationByBusinessKeyAndVariablesUsingFluentCorrelateAll() { assertEquals("aBusinessKey", correlatedProcessInstance.getBusinessKey()); } - @Deployment(resources = "org/camunda/bpm/engine/test/api/runtime/MessageCorrelationTest.testCatchingMessageEventCorrelation.bpmn20.xml") + @Deployment(resources = "org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationTest.testCatchingMessageEventCorrelation.bpmn20.xml") @Test public void testCorrelationByProcessInstanceId() { @@ -1101,7 +1100,7 @@ public void testCorrelationByProcessInstanceId() { runtimeService.deleteProcessInstance(processInstance1.getId(), null); } - @Deployment(resources = "org/camunda/bpm/engine/test/api/runtime/MessageCorrelationTest.testCatchingMessageEventCorrelation.bpmn20.xml") + @Deployment(resources = "org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationTest.testCatchingMessageEventCorrelation.bpmn20.xml") @Test public void testCorrelationByProcessInstanceIdUsingFluentCorrelateAll() { // correlate by name @@ -1142,7 +1141,7 @@ public void testCorrelationByProcessInstanceIdUsingFluentCorrelateAll() { assertNull(uncorrelatedExecution); } - @Deployment(resources = "org/camunda/bpm/engine/test/api/runtime/MessageCorrelationTest.testCatchingMessageEventCorrelation.bpmn20.xml") + @Deployment(resources = "org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationTest.testCatchingMessageEventCorrelation.bpmn20.xml") @Test public void testCorrelationByBusinessKeyAndNullVariableUsingFluentCorrelateAll() { runtimeService.startProcessInstanceByKey("process", "aBusinessKey"); @@ -1163,7 +1162,7 @@ public void testCorrelationByBusinessKeyAndNullVariableUsingFluentCorrelateAll() } - @Deployment(resources = "org/camunda/bpm/engine/test/api/runtime/MessageCorrelationTest.testCatchingMessageEventCorrelation.bpmn20.xml") + @Deployment(resources = "org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationTest.testCatchingMessageEventCorrelation.bpmn20.xml") @Test public void testCorrelationByBusinessKeyAndNullVariableEqualsUsingFluentCorrelateAll() { Map variables = new HashMap<>(); @@ -1186,7 +1185,7 @@ public void testCorrelationByBusinessKeyAndNullVariableEqualsUsingFluentCorrelat } - @Deployment(resources = "org/camunda/bpm/engine/test/api/runtime/MessageCorrelationTest.testCatchingMessageEventCorrelation.bpmn20.xml") + @Deployment(resources = "org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationTest.testCatchingMessageEventCorrelation.bpmn20.xml") @Test public void testCorrelationByBusinessKeyAndNullVariablesUsingFluentCorrelateAll() { runtimeService.startProcessInstanceByKey("process", "aBusinessKey"); @@ -1208,7 +1207,7 @@ public void testCorrelationByBusinessKeyAndNullVariablesUsingFluentCorrelateAll( assertFalse(correlatedExecutions.isEmpty()); } - @Deployment(resources = "org/camunda/bpm/engine/test/api/runtime/MessageCorrelationTest.testCatchingMessageEventCorrelation.bpmn20.xml") + @Deployment(resources = "org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationTest.testCatchingMessageEventCorrelation.bpmn20.xml") @Test public void testCorrelationByVariablesOnly() { Map variables = new HashMap<>(); @@ -1229,7 +1228,7 @@ public void testCorrelationByVariablesOnly() { assertEquals(instance.getId(), correlatedExecutions.get(0).getId()); } - @Deployment(resources = "org/camunda/bpm/engine/test/api/runtime/MessageCorrelationTest.testCatchingMessageEventCorrelation.bpmn20.xml") + @Deployment(resources = "org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationTest.testCatchingMessageEventCorrelation.bpmn20.xml") @Test public void testCorrelationByBusinessKey() { runtimeService.startProcessInstanceByKey("process", "businessKey1"); @@ -1246,7 +1245,7 @@ public void testCorrelationByBusinessKey() { assertEquals(instance.getId(), correlatedExecutions.get(0).getId()); } - @Deployment(resources = "org/camunda/bpm/engine/test/api/runtime/MessageCorrelationTest.testCatchingMessageEventCorrelation.bpmn20.xml") + @Deployment(resources = "org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationTest.testCatchingMessageEventCorrelation.bpmn20.xml") @Test public void testCorrelationByProcessInstanceIdOnly() { runtimeService.startProcessInstanceByKey("process"); @@ -1266,7 +1265,7 @@ public void testCorrelationByProcessInstanceIdOnly() { assertEquals(instance.getId(), correlatedExecutions.get(0).getId()); } - @Deployment(resources = "org/camunda/bpm/engine/test/api/runtime/MessageCorrelationTest.testCatchingMessageEventCorrelation.bpmn20.xml") + @Deployment(resources = "org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationTest.testCatchingMessageEventCorrelation.bpmn20.xml") @Test public void testCorrelationWithoutMessageNameFluent() { Map variables = new HashMap<>(); @@ -1289,8 +1288,8 @@ public void testCorrelationWithoutMessageNameFluent() { assertEquals(instance.getId(), correlatedExecutions.get(0).getId()); } - @Deployment(resources = {"org/camunda/bpm/engine/test/api/runtime/MessageCorrelationTest.testCatchingMessageEventCorrelation.bpmn20.xml", - "org/camunda/bpm/engine/test/api/runtime/MessageCorrelationTest.testCorrelateAllWithoutMessage.bpmn20.xml"}) + @Deployment(resources = {"org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationTest.testCatchingMessageEventCorrelation.bpmn20.xml", + "org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationTest.testCorrelateAllWithoutMessage.bpmn20.xml"}) @Test public void testCorrelateAllWithoutMessage() { Map variables = new HashMap<>(); @@ -1318,7 +1317,7 @@ public void testCorrelateAllWithoutMessage() { assertEquals(instance2.getId(), correlatedExecutions.get(1).getId()); } - @Deployment(resources = "org/camunda/bpm/engine/test/api/runtime/MessageCorrelationTest.testMessageStartEventCorrelation.bpmn20.xml") + @Deployment(resources = "org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationTest.testMessageStartEventCorrelation.bpmn20.xml") @Test public void testCorrelationWithoutMessageDoesNotMatchStartEvent() { try { @@ -1338,7 +1337,7 @@ public void testCorrelationWithoutMessageDoesNotMatchStartEvent() { assertTrue(correlatedExecutions.isEmpty()); } - @Deployment(resources = "org/camunda/bpm/engine/test/api/runtime/MessageCorrelationTest.testCatchingMessageEventCorrelation.bpmn20.xml") + @Deployment(resources = "org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationTest.testCatchingMessageEventCorrelation.bpmn20.xml") @Test public void testCorrelationWithoutCorrelationPropertiesFails() { @@ -1381,7 +1380,7 @@ public void testCorrelationToExecutionWithMultipleSubscriptionsFails() { } } - @Deployment(resources = "org/camunda/bpm/engine/test/api/runtime/MessageCorrelationTest.testCatchingMessageEventCorrelation.bpmn20.xml") + @Deployment(resources = "org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationTest.testCatchingMessageEventCorrelation.bpmn20.xml") @Test public void testSuspendedProcessInstance() { Map variables = new HashMap<>(); @@ -1403,7 +1402,7 @@ public void testSuspendedProcessInstance() { } } - @Deployment(resources = "org/camunda/bpm/engine/test/api/runtime/MessageCorrelationTest.testCatchingMessageEventCorrelation.bpmn20.xml") + @Deployment(resources = "org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationTest.testCatchingMessageEventCorrelation.bpmn20.xml") @Test public void testOneMatchingAndOneSuspendedProcessInstance() { Map variables = new HashMap<>(); @@ -1446,7 +1445,7 @@ public void testOneMatchingAndOneSuspendedProcessInstance() { assertEquals(1, correlatedExecutions); } - @Deployment(resources = "org/camunda/bpm/engine/test/api/runtime/MessageCorrelationTest.testMessageStartEventCorrelation.bpmn20.xml") + @Deployment(resources = "org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationTest.testMessageStartEventCorrelation.bpmn20.xml") @Test public void testSuspendedProcessDefinition() { String processDefinitionId = repositoryService.createProcessDefinitionQuery().singleResult().getId(); @@ -1735,8 +1734,8 @@ public void testCorrelationWithTransientLocalVariables() { assertThat(numHistoricVariables).isEqualTo(0); } - @Deployment(resources = { "org/camunda/bpm/engine/test/api/runtime/MessageCorrelationTest.waitForMessageProcess.bpmn20.xml", - "org/camunda/bpm/engine/test/api/runtime/MessageCorrelationTest.sendMessageProcess.bpmn20.xml" }) + @Deployment(resources = { "org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationTest.waitForMessageProcess.bpmn20.xml", + "org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationTest.sendMessageProcess.bpmn20.xml" }) @Test public void testCorrelateWithResultTwoTimesInSameTransaction() { // start process that waits for message @@ -1759,8 +1758,8 @@ public void testCorrelateWithResultTwoTimesInSameTransaction() { Assert.assertNotNull(waitingProcess); } - @Deployment(resources = { "org/camunda/bpm/engine/test/api/runtime/MessageCorrelationTest.waitForMessageProcess.bpmn20.xml", - "org/camunda/bpm/engine/test/api/runtime/MessageCorrelationTest.sendMessageProcess.bpmn20.xml" }) + @Deployment(resources = { "org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationTest.waitForMessageProcess.bpmn20.xml", + "org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationTest.sendMessageProcess.bpmn20.xml" }) @Test public void testCorrelateAllWithResultTwoTimesInSameTransaction() { // start process that waits for message @@ -1832,7 +1831,7 @@ public void testMessageStartEventCorrelationWithVariablesInResult() { assertEquals("bar", result.getVariables().getValue("foo", String.class)); } - @Deployment(resources = "org/camunda/bpm/engine/test/api/runtime/MessageCorrelationTest.testCatchingMessageEventCorrelation.bpmn20.xml") + @Deployment(resources = "org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationTest.testCatchingMessageEventCorrelation.bpmn20.xml") @Test public void testCorrelateAllWithResultVariables() { //given @@ -2070,7 +2069,7 @@ public void testStartMessageOnlyFlagAll() { assertTwoInstancesAreStarted(firstProcessDefinition, secondProcessDefinition); } - @Deployment(resources = "org/camunda/bpm/engine/test/api/runtime/MessageCorrelationTest.testMessageStartEventCorrelation.bpmn20.xml") + @Deployment(resources = "org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationTest.testMessageStartEventCorrelation.bpmn20.xml") @Test public void testStartMessageOnlyFlagWithResult() { MessageCorrelationResult result = runtimeService.createMessageCorrelation("newInvoiceMessage") @@ -2084,7 +2083,7 @@ public void testStartMessageOnlyFlagWithResult() { assertThat(result.getProcessInstance().getId()).isEqualTo(processInstanceQuery.singleResult().getId()); } - @Deployment(resources = "org/camunda/bpm/engine/test/api/runtime/MessageCorrelationTest.testMessageStartEventCorrelation.bpmn20.xml") + @Deployment(resources = "org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationTest.testMessageStartEventCorrelation.bpmn20.xml") @Test public void testStartMessageOnlyFlagWithVariablesInResult() { @@ -2100,7 +2099,7 @@ public void testStartMessageOnlyFlagWithVariablesInResult() { assertThat(result.getVariables().getValueTyped("aKey").getValue()).isEqualTo("aValue"); } - @Deployment(resources = "org/camunda/bpm/engine/test/api/runtime/MessageCorrelationTest.testMessageStartEventCorrelation.bpmn20.xml") + @Deployment(resources = "org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationTest.testMessageStartEventCorrelation.bpmn20.xml") @Test public void testStartMessageOnlyFlagAllWithResult() { List result = runtimeService.createMessageCorrelation("newInvoiceMessage") @@ -2114,7 +2113,7 @@ public void testStartMessageOnlyFlagAllWithResult() { assertThat(result.get(0).getProcessInstance().getId()).isEqualTo(processInstanceQuery.singleResult().getId()); } - @Deployment(resources = "org/camunda/bpm/engine/test/api/runtime/MessageCorrelationTest.testMessageStartEventCorrelation.bpmn20.xml") + @Deployment(resources = "org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationTest.testMessageStartEventCorrelation.bpmn20.xml") @Test public void testStartMessageOnlyFlagAllWithVariablesInResult() { diff --git a/engine/src/test/java/org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationUserOperationLogTest.java b/engine/src/test/java/org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationUserOperationLogTest.java new file mode 100644 index 00000000000..570e8aa5060 --- /dev/null +++ b/engine/src/test/java/org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationUserOperationLogTest.java @@ -0,0 +1,445 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.engine.test.api.runtime.message; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatThrownBy; +import static org.assertj.core.api.Assertions.tuple; + +import java.util.List; +import java.util.Map; +import org.camunda.bpm.engine.HistoryService; +import org.camunda.bpm.engine.IdentityService; +import org.camunda.bpm.engine.ProcessEngineConfiguration; +import org.camunda.bpm.engine.ProcessEngineException; +import org.camunda.bpm.engine.RuntimeService; +import org.camunda.bpm.engine.history.UserOperationLogEntry; +import org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl; +import org.camunda.bpm.engine.runtime.MessageCorrelationResult; +import org.camunda.bpm.engine.runtime.ProcessInstance; +import org.camunda.bpm.engine.test.Deployment; +import org.camunda.bpm.engine.test.ProcessEngineRule; +import org.camunda.bpm.engine.test.RequiredHistoryLevel; +import org.camunda.bpm.engine.test.util.ProvidedProcessEngineRule; +import org.junit.After; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; + +@RequiredHistoryLevel(ProcessEngineConfiguration.HISTORY_FULL) +public class MessageCorrelationUserOperationLogTest { + + private static final String USER_ID = "userId"; + private static final String SINGLE_INTERMEDIATE_MESSAGE_PROCESS = "intermediateMessage"; + private static final String INTERMEDIATE_MESSAGE_NAME = "intermediate"; + private static final String START_MESSAGE_NAME = "start"; + private static final String NUMBER_OF_INSTANCES = "nrOfInstances"; + private static final String NUMBER_OF_VARIABLES = "nrOfVariables"; + private static final String PROCESS_INSTANCE_ID = "processInstanceId"; + private static final String PROCESS_DEFINITION_ID = "processDefinitionId"; + private static final String MESSAGE_NAME = "messageName"; + private static final String PROPERTY = "property"; + private static final String NEW_VALUE = "newValue"; + + private static final Long LIMIT_1 = 1L; + private static final Long LIMIT_3 = 3L; + private static final Long UNLIMITED = -1L; + + @Rule + public ProcessEngineRule engineRule = new ProvidedProcessEngineRule(); + + protected ProcessEngineConfigurationImpl processEngineConfiguration; + protected RuntimeService runtimeService; + protected HistoryService historyService; + protected IdentityService identityService; + + protected Long defaultLogEntriesPerSyncOperationLimit; + + @Before + public void setup() { + processEngineConfiguration = engineRule.getProcessEngineConfiguration(); + runtimeService = engineRule.getRuntimeService(); + historyService = engineRule.getHistoryService(); + identityService = engineRule.getIdentityService(); + defaultLogEntriesPerSyncOperationLimit = processEngineConfiguration.getLogEntriesPerSyncOperationLimit(); + } + + @After + public void tearDown() { + processEngineConfiguration.setLogEntriesPerSyncOperationLimit(defaultLogEntriesPerSyncOperationLimit); + } + + @Test + @Deployment(resources = {"org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationUserOperationLogTest.intermediateMessageEvent.bpmn" }) + public void shouldCreateSingleUserOperationLogForMessageCorrelationWithReturnVariables() { + // given + // limit for message correlation operation log to 1 + // one process is waiting at one intermediate message catch event + // authenticated user to enable user operation log + processEngineConfiguration.setLogEntriesPerSyncOperationLimit(LIMIT_1); + ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(SINGLE_INTERMEDIATE_MESSAGE_PROCESS, Map.of("foo","bar")); + identityService.setAuthenticatedUserId(USER_ID); + + // when + runtimeService.createMessageCorrelation(INTERMEDIATE_MESSAGE_NAME).correlateAllWithResultAndVariables(false); + + // then + String processInstanceId = processInstance.getId(); + String processDefinitionId = processInstance.getProcessDefinitionId(); + List logs = historyService.createUserOperationLogQuery().operationType(UserOperationLogEntry.OPERATION_TYPE_CORRELATE_MESSAGE).list(); + assertThat(logs).hasSize(2); // only the two properties for this message correlation are found, no variables set + assertThat(logs) + .extracting(PROPERTY, NEW_VALUE, PROCESS_INSTANCE_ID, PROCESS_DEFINITION_ID) + .containsExactlyInAnyOrder( + tuple(MESSAGE_NAME, INTERMEDIATE_MESSAGE_NAME, processInstanceId, processDefinitionId), + tuple(PROCESS_INSTANCE_ID, processInstanceId, processInstanceId, processDefinitionId)); + } + + @Test + @Deployment(resources = {"org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationUserOperationLogTest.intermediateMessageEvent.bpmn" }) + public void shouldCreateSingleUserOperationLogForMessageCorrelationWithVariables() { + // given + // limit for message correlation operation log to 1 + // one process is waiting at one intermediate message catch event + // authenticated user to enable user operation log + processEngineConfiguration.setLogEntriesPerSyncOperationLimit(LIMIT_1); + ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(SINGLE_INTERMEDIATE_MESSAGE_PROCESS); + identityService.setAuthenticatedUserId(USER_ID); + + // when + runtimeService.createMessageCorrelation(INTERMEDIATE_MESSAGE_NAME).setVariable("foo", "bar").correlateAll(); + + // then + String processInstanceId = processInstance.getId(); + String processDefinitionId = processInstance.getProcessDefinitionId(); + List logs = historyService.createUserOperationLogQuery().operationType(UserOperationLogEntry.OPERATION_TYPE_CORRELATE_MESSAGE).list(); + assertThat(logs).hasSize(3); // only the three properties for this message correlation are found + assertThat(logs) + .extracting(PROPERTY, NEW_VALUE, PROCESS_INSTANCE_ID, PROCESS_DEFINITION_ID) + .containsExactlyInAnyOrder( + tuple(MESSAGE_NAME, INTERMEDIATE_MESSAGE_NAME, processInstanceId, processDefinitionId), + tuple(PROCESS_INSTANCE_ID, processInstanceId, processInstanceId, processDefinitionId), + tuple(NUMBER_OF_VARIABLES, "1", processInstanceId, processDefinitionId)); + } + + @Test + @Deployment(resources = {"org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationUserOperationLogTest.intermediateMessageEvent.bpmn" }) + public void shouldCreateSummarizingUserOperationLogForMessageCorrelations() { + // given + // limit for message correlation operation log to 1 -> only one summary op log + // three processes are waiting at one intermediate message catch event + // authenticated user to enable user operation log + processEngineConfiguration.setLogEntriesPerSyncOperationLimit(LIMIT_1); + ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(SINGLE_INTERMEDIATE_MESSAGE_PROCESS); + runtimeService.startProcessInstanceByKey(SINGLE_INTERMEDIATE_MESSAGE_PROCESS); + runtimeService.startProcessInstanceByKey(SINGLE_INTERMEDIATE_MESSAGE_PROCESS); + identityService.setAuthenticatedUserId(USER_ID); + + // when + runtimeService.createMessageCorrelation(INTERMEDIATE_MESSAGE_NAME).correlateAll(); + + // then + String processDefinitionId = processInstance.getProcessDefinitionId(); + List logs = historyService.createUserOperationLogQuery().operationType(UserOperationLogEntry.OPERATION_TYPE_CORRELATE_MESSAGE).list(); + assertThat(logs).hasSize(2); // only two properties found summarizing the operation + assertThat(logs) + .extracting(PROPERTY, NEW_VALUE, PROCESS_INSTANCE_ID, PROCESS_DEFINITION_ID) + .containsExactlyInAnyOrder( + tuple(MESSAGE_NAME, INTERMEDIATE_MESSAGE_NAME, null, processDefinitionId), + tuple(NUMBER_OF_INSTANCES, "3", null, processDefinitionId)); + } + + @Test + @Deployment(resources = {"org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationUserOperationLogTest.intermediateMessageEvent.bpmn" }) + public void shouldCreateDetailedUserOperationLogForMessageCorrelationsWhenOnlyOneCorrelation() { + // given + // limit for message correlation operation log to 1 + // one process is waiting at one intermediate message catch event + // authenticated user to enable user operation log + processEngineConfiguration.setLogEntriesPerSyncOperationLimit(LIMIT_1); + ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(SINGLE_INTERMEDIATE_MESSAGE_PROCESS); + identityService.setAuthenticatedUserId(USER_ID); + + // when + List correlationResult = runtimeService.createMessageCorrelation(INTERMEDIATE_MESSAGE_NAME).correlateAllWithResult(); + + // then + String processInstanceId = processInstance.getId(); + String processDefinitionId = processInstance.getProcessDefinitionId(); + List logs = historyService.createUserOperationLogQuery().operationType(UserOperationLogEntry.OPERATION_TYPE_CORRELATE_MESSAGE).list(); + assertThat(logs).hasSize(2); // only the two properties for this message correlation are found, no variables set + assertThat(logs) + .extracting(PROPERTY, NEW_VALUE, PROCESS_INSTANCE_ID, PROCESS_DEFINITION_ID) + .containsExactlyInAnyOrder( + tuple(MESSAGE_NAME, INTERMEDIATE_MESSAGE_NAME, processInstanceId, processDefinitionId), + tuple(PROCESS_INSTANCE_ID, processInstanceId, processInstanceId, processDefinitionId)); + } + + @Test + @Deployment(resources = {"org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationUserOperationLogTest.intermediateMessageEvent.bpmn" }) + public void shouldCreateUserOperationLogForMessageCorrelations() { + // given + // limit for message correlation operation log to 3 + // three processes are waiting at one intermediate message catch event + // authenticated user to enable user operation log + processEngineConfiguration.setLogEntriesPerSyncOperationLimit(LIMIT_3); + ProcessInstance processInstance1 = runtimeService.startProcessInstanceByKey(SINGLE_INTERMEDIATE_MESSAGE_PROCESS); + ProcessInstance processInstance2 = runtimeService.startProcessInstanceByKey(SINGLE_INTERMEDIATE_MESSAGE_PROCESS); + ProcessInstance processInstance3 = runtimeService.startProcessInstanceByKey(SINGLE_INTERMEDIATE_MESSAGE_PROCESS); + identityService.setAuthenticatedUserId(USER_ID); + + // when + runtimeService.createMessageCorrelation(INTERMEDIATE_MESSAGE_NAME).correlateAll(); + + // then + List logs = historyService.createUserOperationLogQuery().operationType(UserOperationLogEntry.OPERATION_TYPE_CORRELATE_MESSAGE).list(); + assertThat(logs).hasSize(6); // two properties per process instance found + String processDefinitionId = processInstance1.getProcessDefinitionId(); + String processInstanceId1 = processInstance1.getId(); + List p1Logs = historyService.createUserOperationLogQuery().operationType(UserOperationLogEntry.OPERATION_TYPE_CORRELATE_MESSAGE).processInstanceId(processInstanceId1).list(); + assertThat(p1Logs) + .extracting(PROPERTY, NEW_VALUE, PROCESS_INSTANCE_ID, PROCESS_DEFINITION_ID) + .containsExactlyInAnyOrder( + tuple(MESSAGE_NAME, INTERMEDIATE_MESSAGE_NAME, processInstanceId1, processDefinitionId), + tuple(PROCESS_INSTANCE_ID, processInstanceId1, processInstanceId1, processDefinitionId)); + String processInstanceId2 = processInstance2.getId(); + List p2Logs = historyService.createUserOperationLogQuery().operationType(UserOperationLogEntry.OPERATION_TYPE_CORRELATE_MESSAGE).processInstanceId(processInstanceId2).list(); + assertThat(p2Logs) + .extracting(PROPERTY, NEW_VALUE, PROCESS_INSTANCE_ID, PROCESS_DEFINITION_ID) + .containsExactlyInAnyOrder( + tuple(MESSAGE_NAME, INTERMEDIATE_MESSAGE_NAME, processInstanceId2, processDefinitionId), + tuple(PROCESS_INSTANCE_ID, processInstanceId2, processInstanceId2, processDefinitionId)); + String processInstanceId3 = processInstance3.getId(); + List p3Logs = historyService.createUserOperationLogQuery().operationType(UserOperationLogEntry.OPERATION_TYPE_CORRELATE_MESSAGE).processInstanceId(processInstanceId3).list(); + assertThat(p3Logs) + .extracting(PROPERTY, NEW_VALUE, PROCESS_INSTANCE_ID, PROCESS_DEFINITION_ID) + .containsExactlyInAnyOrder( + tuple(MESSAGE_NAME, INTERMEDIATE_MESSAGE_NAME, processInstanceId3, processDefinitionId), + tuple(PROCESS_INSTANCE_ID, processInstanceId3, processInstanceId3, processDefinitionId)); + } + + @Test + @Deployment(resources = {"org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationUserOperationLogTest.intermediateMessageEvent.bpmn" }) + public void shouldThrowExceptionForMessageCorrelationsExceedingLimit() { + // given + // limit for message correlation operation log to 3 + // four processes are waiting at one intermediate message catch event + // authenticated user to enable user operation log + processEngineConfiguration.setLogEntriesPerSyncOperationLimit(LIMIT_3); + runtimeService.startProcessInstanceByKey(SINGLE_INTERMEDIATE_MESSAGE_PROCESS).getId(); + runtimeService.startProcessInstanceByKey(SINGLE_INTERMEDIATE_MESSAGE_PROCESS).getId(); + runtimeService.startProcessInstanceByKey(SINGLE_INTERMEDIATE_MESSAGE_PROCESS).getId(); + runtimeService.startProcessInstanceByKey(SINGLE_INTERMEDIATE_MESSAGE_PROCESS).getId(); + identityService.setAuthenticatedUserId(USER_ID); + + // when + assertThatThrownBy(() -> runtimeService.createMessageCorrelation(INTERMEDIATE_MESSAGE_NAME).correlateAll()) + + // then + .isInstanceOf(ProcessEngineException.class) + .hasMessage("Maximum number of operation log entries for operation type synchronous APIs reached. Configured limit is 3 but 4 entities were affected by API call."); + + List logs = historyService.createUserOperationLogQuery().operationType(UserOperationLogEntry.OPERATION_TYPE_CORRELATE_MESSAGE).list(); + assertThat(logs).isEmpty(); + } + + @Test + @Deployment(resources = {"org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationUserOperationLogTest.intermediateMessageEvent.bpmn" }) + public void shouldCreateUserOperationLogForMessageCorrelationsWhenUnlimited() { + // given + // operation log for message correlation is not limited (-1) + // four processes are waiting at one intermediate message catch event + // authenticated user to enable user operation log + processEngineConfiguration.setLogEntriesPerSyncOperationLimit(UNLIMITED); + ProcessInstance processInstance1 = runtimeService.startProcessInstanceByKey(SINGLE_INTERMEDIATE_MESSAGE_PROCESS); + ProcessInstance processInstance2 = runtimeService.startProcessInstanceByKey(SINGLE_INTERMEDIATE_MESSAGE_PROCESS); + ProcessInstance processInstance3 = runtimeService.startProcessInstanceByKey(SINGLE_INTERMEDIATE_MESSAGE_PROCESS); + ProcessInstance processInstance4 = runtimeService.startProcessInstanceByKey(SINGLE_INTERMEDIATE_MESSAGE_PROCESS); + identityService.setAuthenticatedUserId(USER_ID); + + // when + runtimeService.createMessageCorrelation(INTERMEDIATE_MESSAGE_NAME).correlateAll(); + + // then + List logs = historyService.createUserOperationLogQuery().operationType(UserOperationLogEntry.OPERATION_TYPE_CORRELATE_MESSAGE).list(); + assertThat(logs).hasSize(8); // two properties per process instance found + String processDefinitionId = processInstance1.getProcessDefinitionId(); + String processInstanceId1 = processInstance1.getId(); + List p1Logs = historyService.createUserOperationLogQuery().operationType(UserOperationLogEntry.OPERATION_TYPE_CORRELATE_MESSAGE).processInstanceId(processInstanceId1).list(); + assertThat(p1Logs) + .extracting(PROPERTY, NEW_VALUE, PROCESS_INSTANCE_ID, PROCESS_DEFINITION_ID) + .containsExactlyInAnyOrder( + tuple(MESSAGE_NAME, INTERMEDIATE_MESSAGE_NAME, processInstanceId1, processDefinitionId), + tuple(PROCESS_INSTANCE_ID, processInstanceId1, processInstanceId1, processDefinitionId)); + String processInstanceId2 = processInstance2.getId(); + List p2Logs = historyService.createUserOperationLogQuery().operationType(UserOperationLogEntry.OPERATION_TYPE_CORRELATE_MESSAGE).processInstanceId(processInstanceId2).list(); + assertThat(p2Logs) + .extracting(PROPERTY, NEW_VALUE, PROCESS_INSTANCE_ID, PROCESS_DEFINITION_ID) + .containsExactlyInAnyOrder( + tuple(MESSAGE_NAME, INTERMEDIATE_MESSAGE_NAME, processInstanceId2, processDefinitionId), + tuple(PROCESS_INSTANCE_ID, processInstanceId2, processInstanceId2, processDefinitionId)); + String processInstanceId3 = processInstance3.getId(); + List p3Logs = historyService.createUserOperationLogQuery().operationType(UserOperationLogEntry.OPERATION_TYPE_CORRELATE_MESSAGE).processInstanceId(processInstanceId3).list(); + assertThat(p3Logs) + .extracting(PROPERTY, NEW_VALUE, PROCESS_INSTANCE_ID, PROCESS_DEFINITION_ID) + .containsExactlyInAnyOrder( + tuple(MESSAGE_NAME, INTERMEDIATE_MESSAGE_NAME, processInstanceId3, processDefinitionId), + tuple(PROCESS_INSTANCE_ID, processInstanceId3, processInstanceId3, processDefinitionId)); + String processInstanceId4 = processInstance4.getId(); + List p4Logs = historyService.createUserOperationLogQuery().operationType(UserOperationLogEntry.OPERATION_TYPE_CORRELATE_MESSAGE).processInstanceId(processInstanceId4).list(); + assertThat(p4Logs) + .extracting(PROPERTY, NEW_VALUE, PROCESS_INSTANCE_ID, PROCESS_DEFINITION_ID) + .containsExactlyInAnyOrder( + tuple(MESSAGE_NAME, INTERMEDIATE_MESSAGE_NAME, processInstanceId4, processDefinitionId), + tuple(PROCESS_INSTANCE_ID, processInstanceId4, processInstanceId4, processDefinitionId)); + } + + @Test + @Deployment(resources = {"org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationUserOperationLogTest.intermediateMessageEvent.bpmn" }) + public void shouldNotCreateUserOperationLogIfNoCorrelationResult() { + // given + // limit for message correlation operation log to 1 + // no processes are waiting at an intermediate message catch event + // authenticated user to enable user operation log + processEngineConfiguration.setLogEntriesPerSyncOperationLimit(LIMIT_1); + identityService.setAuthenticatedUserId(USER_ID); + + // when + runtimeService.createMessageCorrelation(INTERMEDIATE_MESSAGE_NAME).correlateAll(); + + // then + List logs = historyService.createUserOperationLogQuery().operationType(UserOperationLogEntry.OPERATION_TYPE_CORRELATE_MESSAGE).list(); + assertThat(logs).isEmpty(); + } + + @Test + @Deployment(resources = {"org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationUserOperationLogTest.messageStartEvent.bpmn" }) + public void shouldCreateSingleUserOperationLogForMessageCorrelationStart() { + // given + // limit for message correlation operation log to 1 + // no processes are waiting at an intermediate message catch event + // authenticated user to enable user operation log + processEngineConfiguration.setLogEntriesPerSyncOperationLimit(LIMIT_1); + identityService.setAuthenticatedUserId(USER_ID); + + // when + List correlationResult = runtimeService.createMessageCorrelation(START_MESSAGE_NAME).correlateAllWithResult(); + + // then correlation should always start only one instance + assertThat(correlationResult).hasSize(1); // only one instance is started even with correlateAll + List logs = historyService.createUserOperationLogQuery().operationType(UserOperationLogEntry.OPERATION_TYPE_CORRELATE_MESSAGE).list(); + assertThat(logs).hasSize(2); // only the two properties for a single message correlation are found + + ProcessInstance processInstance = correlationResult.get(0).getProcessInstance(); + String processInstanceId = processInstance.getId(); + String processDefinitionId = processInstance.getProcessDefinitionId(); + assertThat(logs) + .extracting(PROPERTY, NEW_VALUE, PROCESS_INSTANCE_ID, PROCESS_DEFINITION_ID) + .containsExactlyInAnyOrder( + tuple(MESSAGE_NAME, START_MESSAGE_NAME, processInstanceId, processDefinitionId), + tuple(PROCESS_INSTANCE_ID, processInstanceId, processInstanceId, processDefinitionId)); + } + + @Test + @Deployment(resources = {"org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationUserOperationLogTest.messageStartEvent.bpmn" }) + public void shouldCreateSingleUserOperationLogForMessageCorrelationStartWithinLimit() { + // given + // limit for message correlation operation log to 3 + // no processes are waiting at an intermediate message catch event + // authenticated user to enable user operation log + processEngineConfiguration.setLogEntriesPerSyncOperationLimit(LIMIT_3); + identityService.setAuthenticatedUserId(USER_ID); + + // when + List correlationResult = runtimeService.createMessageCorrelation(START_MESSAGE_NAME).correlateAllWithResult(); + + // then correlation should always start only one instance + assertThat(correlationResult).hasSize(1); // only one instance is started even with correlateAll + List logs = historyService.createUserOperationLogQuery().operationType(UserOperationLogEntry.OPERATION_TYPE_CORRELATE_MESSAGE).list(); + assertThat(logs).hasSize(2); // only the two properties for a single message correlation are found + + ProcessInstance processInstance = correlationResult.get(0).getProcessInstance(); + String processInstanceId = processInstance.getId(); + String processDefinitionId = processInstance.getProcessDefinitionId(); + assertThat(logs) + .extracting(PROPERTY, NEW_VALUE, PROCESS_INSTANCE_ID, PROCESS_DEFINITION_ID) + .containsExactlyInAnyOrder( + tuple(MESSAGE_NAME, START_MESSAGE_NAME, processInstanceId, processDefinitionId), + tuple(PROCESS_INSTANCE_ID, processInstanceId, processInstanceId, processDefinitionId)); + } + + @Test + @Deployment(resources = {"org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationUserOperationLogTest.messageStartEvent.bpmn" }) + public void shouldCreateSingleUserOperationLogForMessageCorrelationStartUnlimited() { + // given + // limit for message correlation operation log to -1 + // no processes are waiting at an intermediate message catch event + // authenticated user to enable user operation log + processEngineConfiguration.setLogEntriesPerSyncOperationLimit(UNLIMITED); + identityService.setAuthenticatedUserId(USER_ID); + + // when + List correlationResult = runtimeService.createMessageCorrelation(START_MESSAGE_NAME).correlateAllWithResult(); + + // then correlation should always start only one instance + assertThat(correlationResult).hasSize(1); // only one instance is started even with correlateAll + List logs = historyService.createUserOperationLogQuery().operationType(UserOperationLogEntry.OPERATION_TYPE_CORRELATE_MESSAGE).list(); + assertThat(logs).hasSize(2); // only the two properties for a single message correlation are found + + ProcessInstance processInstance = correlationResult.get(0).getProcessInstance(); + String processInstanceId = processInstance.getId(); + String processDefinitionId = processInstance.getProcessDefinitionId(); + assertThat(logs) + .extracting(PROPERTY, NEW_VALUE, PROCESS_INSTANCE_ID, PROCESS_DEFINITION_ID) + .containsExactlyInAnyOrder( + tuple(MESSAGE_NAME, START_MESSAGE_NAME, processInstanceId, processDefinitionId), + tuple(PROCESS_INSTANCE_ID, processInstanceId, processInstanceId, processDefinitionId)); + } + + @Test + @Deployment(resources = {"org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationUserOperationLogTest.messageStartEvent.bpmn" }) + public void shouldCreateSingleUserOperationLogForMessageCorrelationStartWithVariables() { + // given + // limit for message correlation operation log to 1 + // no processes are waiting at an intermediate message catch event + // authenticated user to enable user operation log + processEngineConfiguration.setLogEntriesPerSyncOperationLimit(LIMIT_1); + identityService.setAuthenticatedUserId(USER_ID); + + // when + List correlationResult = runtimeService.createMessageCorrelation(START_MESSAGE_NAME) + .setVariable("foo","bar") + .setVariableLocal("foobar","baz") + .setVariablesToTriggeredScope(Map.of("qux", "bar", "thud", "foo")) + .correlateAllWithResult(); + + // then correlation should always start only one instance + assertThat(correlationResult).hasSize(1); // only one instance is started even with correlateAll + List logs = historyService.createUserOperationLogQuery().operationType(UserOperationLogEntry.OPERATION_TYPE_CORRELATE_MESSAGE).list(); + assertThat(logs).hasSize(3); // only the three properties for a single message correlation are found + + ProcessInstance processInstance = correlationResult.get(0).getProcessInstance(); + String processInstanceId = processInstance.getId(); + String processDefinitionId = processInstance.getProcessDefinitionId(); + assertThat(logs) + .extracting(PROPERTY, NEW_VALUE, PROCESS_INSTANCE_ID, PROCESS_DEFINITION_ID) + .containsExactlyInAnyOrder( + tuple(MESSAGE_NAME, START_MESSAGE_NAME, processInstanceId, processDefinitionId), + tuple(PROCESS_INSTANCE_ID, processInstanceId, processInstanceId, processDefinitionId), + tuple(NUMBER_OF_VARIABLES, "4", processInstanceId, processDefinitionId)); // all variables are counted + } +} diff --git a/engine/src/test/java/org/camunda/bpm/engine/test/history/useroperationlog/SyncApiUserOperationLogLimitConfigurationTest.java b/engine/src/test/java/org/camunda/bpm/engine/test/history/useroperationlog/SyncApiUserOperationLogLimitConfigurationTest.java new file mode 100644 index 00000000000..88241765d72 --- /dev/null +++ b/engine/src/test/java/org/camunda/bpm/engine/test/history/useroperationlog/SyncApiUserOperationLogLimitConfigurationTest.java @@ -0,0 +1,114 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.engine.test.history.useroperationlog; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatThrownBy; + +import org.camunda.bpm.engine.ProcessEngine; +import org.camunda.bpm.engine.ProcessEngineConfiguration; +import org.camunda.bpm.engine.ProcessEngineException; +import org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl; +import org.junit.After; +import org.junit.Test; + +public class SyncApiUserOperationLogLimitConfigurationTest { + + ProcessEngine engine; + + @After + public void tearDown() { + if(engine != null) { + engine.close(); + } + } + + @Test + public void shouldConfigureDefault() { + // given standard configuration + ProcessEngineConfigurationImpl processEngineConfiguration = (ProcessEngineConfigurationImpl) ProcessEngineConfiguration + .createProcessEngineConfigurationFromResource("camunda.cfg.xml"); + + // when engine startup + startEngineManaged(processEngineConfiguration); + + // then + assertThat(processEngineConfiguration.getLogEntriesPerSyncOperationLimit()).isEqualTo(1L); + } + + @Test + public void shouldAllowToConfigureNegativeOne() { + // given configuration with logEntriesPerSyncOperationLimit=-1 + ProcessEngineConfigurationImpl processEngineConfiguration = (ProcessEngineConfigurationImpl) ProcessEngineConfiguration + .createProcessEngineConfigurationFromResource( + "/org/camunda/bpm/engine/test/history/useroperationlog/SyncApiUserOperationLogLimitConfigurationTest.shouldAllowToConfigureNegativeOne.cfg.xml"); + + // when engine startup + startEngineManaged(processEngineConfiguration); + + // then no exceptions + assertThat(processEngineConfiguration.getLogEntriesPerSyncOperationLimit()).isEqualTo(-1L); + } + + @Test + public void shouldAllowToConfigurePositiveValue() { + // given configuration with logEntriesPerSyncOperationLimit=17000 + ProcessEngineConfigurationImpl processEngineConfiguration = (ProcessEngineConfigurationImpl) ProcessEngineConfiguration + .createProcessEngineConfigurationFromResource( + "/org/camunda/bpm/engine/test/history/useroperationlog/SyncApiUserOperationLogLimitConfigurationTest.shouldAllowToConfigurePositiveValue.cfg.xml"); + + // when engine startup + startEngineManaged(processEngineConfiguration); + + // then no exceptions + assertThat(processEngineConfiguration.getLogEntriesPerSyncOperationLimit()).isEqualTo(17000); + } + + @Test + public void shouldThrowExceptionWhenConfigureZero() { + // given configuration with logEntriesPerSyncOperationLimit=0 + ProcessEngineConfigurationImpl processEngineConfiguration = (ProcessEngineConfigurationImpl) ProcessEngineConfiguration + .createProcessEngineConfigurationFromResource( + "/org/camunda/bpm/engine/test/history/useroperationlog/SyncApiUserOperationLogLimitConfigurationTest.shouldThrowExceptionWhenConfigureZero.cfg.xml"); + + // when engine startup + assertThatThrownBy(() -> startEngineManaged(processEngineConfiguration)) + // then + .isInstanceOf(ProcessEngineException.class) + .hasMessage("Invalid configuration for logEntriesPerSyncOperationLimit. Configured value needs to be either -1 or greater than 0 but was 0."); + } + + @Test + public void shouldThrowExceptionWhenConfigureLowNegativeValue() { + // given configuration with logEntriesPerSyncOperationLimit=-10 + ProcessEngineConfigurationImpl processEngineConfiguration = (ProcessEngineConfigurationImpl) ProcessEngineConfiguration + .createProcessEngineConfigurationFromResource( + "/org/camunda/bpm/engine/test/history/useroperationlog/SyncApiUserOperationLogLimitConfigurationTest.shouldThrowExceptionWhenConfigureLowNegativeValue.cfg.xml"); + + // when engine startup + assertThatThrownBy(() -> startEngineManaged(processEngineConfiguration)) + // then + .isInstanceOf(ProcessEngineException.class) + .hasMessage("Invalid configuration for logEntriesPerSyncOperationLimit. Configured value needs to be either -1 or greater than 0 but was -10."); + } + + private ProcessEngine startEngineManaged(ProcessEngineConfiguration config) { + engine = config.buildProcessEngine(); + return engine; + } + +} diff --git a/engine/src/test/resources/org/camunda/bpm/engine/test/api/runtime/MessageCorrelationTest.sendMessageProcess.bpmn20.xml b/engine/src/test/resources/org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationTest.sendMessageProcess.bpmn20.xml similarity index 100% rename from engine/src/test/resources/org/camunda/bpm/engine/test/api/runtime/MessageCorrelationTest.sendMessageProcess.bpmn20.xml rename to engine/src/test/resources/org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationTest.sendMessageProcess.bpmn20.xml diff --git a/engine/src/test/resources/org/camunda/bpm/engine/test/api/runtime/MessageCorrelationTest.testCatchingMessageEventCorrelation.bpmn20.xml b/engine/src/test/resources/org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationTest.testCatchingMessageEventCorrelation.bpmn20.xml similarity index 100% rename from engine/src/test/resources/org/camunda/bpm/engine/test/api/runtime/MessageCorrelationTest.testCatchingMessageEventCorrelation.bpmn20.xml rename to engine/src/test/resources/org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationTest.testCatchingMessageEventCorrelation.bpmn20.xml diff --git a/engine/src/test/resources/org/camunda/bpm/engine/test/api/runtime/MessageCorrelationTest.testCorrelateAllWithoutMessage.bpmn20.xml b/engine/src/test/resources/org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationTest.testCorrelateAllWithoutMessage.bpmn20.xml similarity index 100% rename from engine/src/test/resources/org/camunda/bpm/engine/test/api/runtime/MessageCorrelationTest.testCorrelateAllWithoutMessage.bpmn20.xml rename to engine/src/test/resources/org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationTest.testCorrelateAllWithoutMessage.bpmn20.xml diff --git a/engine/src/test/resources/org/camunda/bpm/engine/test/api/runtime/MessageCorrelationTest.testMatchingStartEventAndExecution.bpmn20.xml b/engine/src/test/resources/org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationTest.testMatchingStartEventAndExecution.bpmn20.xml similarity index 100% rename from engine/src/test/resources/org/camunda/bpm/engine/test/api/runtime/MessageCorrelationTest.testMatchingStartEventAndExecution.bpmn20.xml rename to engine/src/test/resources/org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationTest.testMatchingStartEventAndExecution.bpmn20.xml diff --git a/engine/src/test/resources/org/camunda/bpm/engine/test/api/runtime/MessageCorrelationTest.testMessageStartEventCorrelation.bpmn20.xml b/engine/src/test/resources/org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationTest.testMessageStartEventCorrelation.bpmn20.xml similarity index 100% rename from engine/src/test/resources/org/camunda/bpm/engine/test/api/runtime/MessageCorrelationTest.testMessageStartEventCorrelation.bpmn20.xml rename to engine/src/test/resources/org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationTest.testMessageStartEventCorrelation.bpmn20.xml diff --git a/engine/src/test/resources/org/camunda/bpm/engine/test/api/runtime/MessageCorrelationTest.testMultipleMessageStartEventsCorrelation.bpmn20.xml b/engine/src/test/resources/org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationTest.testMultipleMessageStartEventsCorrelation.bpmn20.xml similarity index 100% rename from engine/src/test/resources/org/camunda/bpm/engine/test/api/runtime/MessageCorrelationTest.testMultipleMessageStartEventsCorrelation.bpmn20.xml rename to engine/src/test/resources/org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationTest.testMultipleMessageStartEventsCorrelation.bpmn20.xml diff --git a/engine/src/test/resources/org/camunda/bpm/engine/test/api/runtime/MessageCorrelationTest.waitForMessageProcess.bpmn20.xml b/engine/src/test/resources/org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationTest.waitForMessageProcess.bpmn20.xml similarity index 100% rename from engine/src/test/resources/org/camunda/bpm/engine/test/api/runtime/MessageCorrelationTest.waitForMessageProcess.bpmn20.xml rename to engine/src/test/resources/org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationTest.waitForMessageProcess.bpmn20.xml diff --git a/engine/src/test/resources/org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationUserOperationLogTest.intermediateMessageEvent.bpmn b/engine/src/test/resources/org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationUserOperationLogTest.intermediateMessageEvent.bpmn new file mode 100644 index 00000000000..6cbc3c432ae --- /dev/null +++ b/engine/src/test/resources/org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationUserOperationLogTest.intermediateMessageEvent.bpmn @@ -0,0 +1,40 @@ + + + + + Flow_19fnzhs + + + + Flow_19fnzhs + Flow_0kcimof + + + + Flow_0kcimof + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/engine/src/test/resources/org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationUserOperationLogTest.messageStartEvent.bpmn b/engine/src/test/resources/org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationUserOperationLogTest.messageStartEvent.bpmn new file mode 100644 index 00000000000..9a9d5eec25a --- /dev/null +++ b/engine/src/test/resources/org/camunda/bpm/engine/test/api/runtime/message/MessageCorrelationUserOperationLogTest.messageStartEvent.bpmn @@ -0,0 +1,28 @@ + + + + + + Flow_19fnzhs + + + Flow_19fnzhs + + + + + + + + + + + + + + + + + + + diff --git a/engine/src/test/resources/org/camunda/bpm/engine/test/history/useroperationlog/SyncApiUserOperationLogLimitConfigurationTest.shouldAllowToConfigureNegativeOne.cfg.xml b/engine/src/test/resources/org/camunda/bpm/engine/test/history/useroperationlog/SyncApiUserOperationLogLimitConfigurationTest.shouldAllowToConfigureNegativeOne.cfg.xml new file mode 100644 index 00000000000..b58d4a0656f --- /dev/null +++ b/engine/src/test/resources/org/camunda/bpm/engine/test/history/useroperationlog/SyncApiUserOperationLogLimitConfigurationTest.shouldAllowToConfigureNegativeOne.cfg.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/engine/src/test/resources/org/camunda/bpm/engine/test/history/useroperationlog/SyncApiUserOperationLogLimitConfigurationTest.shouldAllowToConfigurePositiveValue.cfg.xml b/engine/src/test/resources/org/camunda/bpm/engine/test/history/useroperationlog/SyncApiUserOperationLogLimitConfigurationTest.shouldAllowToConfigurePositiveValue.cfg.xml new file mode 100644 index 00000000000..978a7cee27b --- /dev/null +++ b/engine/src/test/resources/org/camunda/bpm/engine/test/history/useroperationlog/SyncApiUserOperationLogLimitConfigurationTest.shouldAllowToConfigurePositiveValue.cfg.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/engine/src/test/resources/org/camunda/bpm/engine/test/history/useroperationlog/SyncApiUserOperationLogLimitConfigurationTest.shouldThrowExceptionWhenConfigureLowNegativeValue.cfg.xml b/engine/src/test/resources/org/camunda/bpm/engine/test/history/useroperationlog/SyncApiUserOperationLogLimitConfigurationTest.shouldThrowExceptionWhenConfigureLowNegativeValue.cfg.xml new file mode 100644 index 00000000000..78dd1cc82ba --- /dev/null +++ b/engine/src/test/resources/org/camunda/bpm/engine/test/history/useroperationlog/SyncApiUserOperationLogLimitConfigurationTest.shouldThrowExceptionWhenConfigureLowNegativeValue.cfg.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/engine/src/test/resources/org/camunda/bpm/engine/test/history/useroperationlog/SyncApiUserOperationLogLimitConfigurationTest.shouldThrowExceptionWhenConfigureZero.cfg.xml b/engine/src/test/resources/org/camunda/bpm/engine/test/history/useroperationlog/SyncApiUserOperationLogLimitConfigurationTest.shouldThrowExceptionWhenConfigureZero.cfg.xml new file mode 100644 index 00000000000..093bb8ba0c0 --- /dev/null +++ b/engine/src/test/resources/org/camunda/bpm/engine/test/history/useroperationlog/SyncApiUserOperationLogLimitConfigurationTest.shouldThrowExceptionWhenConfigureZero.cfg.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + +