Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: yanavasileva <[email protected]>
  • Loading branch information
psavidis and yanavasileva authored Jun 19, 2024
1 parent ab82aac commit 5a72e79
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@
package org.camunda.bpm.engine.impl.persistence.entity;

import java.io.Serializable;
import java.util.*;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.concurrent.Callable;

import org.camunda.bpm.application.InvocationContext;
Expand Down Expand Up @@ -154,7 +158,7 @@ public void delete() {
}

// clear value
clearValueFieldsBasedOnType(true);
clearValueFields(true);

if (!isTransient) {
// delete variable
Expand Down Expand Up @@ -283,13 +287,13 @@ public void setValue(TypedValue newValue) {

public void clearValueFieldsBasedOnType(TypedValue newValue) {
if (variableWillChangeType(newValue)) {
clearValueFieldsBasedOnType(true);
clearValueFields(true);
} else {
clearValueFieldsBasedOnType(false);
clearValueFields(false);
}
}

public void clearValueFieldsBasedOnType(boolean deleteVariable) {
public void clearValueFields(boolean deleteVariable) {
this.longValue = null;
this.doubleValue = null;
this.textValue = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,7 @@ private ProcessInstance startProcessInstanceWithVariable(String processDefinitio
VariableMap variables = Variables.createVariables()
.putValue(variableName, variableValue);

String businessKey = processDefinitionKey; // for simplicity’s sake, same businessKey with processDefinitionKey
return runtimeService.startProcessInstanceByKey(processDefinitionKey, businessKey, variables);
return runtimeService.startProcessInstanceByKey(processDefinitionKey, variables);
}

private ProcessInstance startProcessInstanceWithObjectVariable(String processDefinitionKey, String variableName, Object variableValue) {
Expand Down

0 comments on commit 5a72e79

Please sign in to comment.