Skip to content

Commit

Permalink
Merge branch 'flowable6.x' into flowable-release-6.8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
filiphr committed Jun 29, 2023
2 parents 5aecbfe + 3168e1b commit 19e5c43
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ public void testDeleteProcessVariable() throws Exception {
* PUT cmmn-runtime/case-instances/{caseInstanceId}/variables/{variableName}
*/
@CmmnDeployment(resources = { "org/flowable/cmmn/rest/service/api/repository/oneHumanTaskCase.cmmn" })
public void testUpdateProcessVariable() throws Exception {
public void testUpdateCaseVariable() throws Exception {
CaseInstance caseInstance = runtimeService.createCaseInstanceBuilder().caseDefinitionKey("oneHumanTaskCase")
.variables(Collections.singletonMap("overlappingVariable", (Object) "processValue")).start();
runtimeService.setVariable(caseInstance.getId(), "myVar", "value");
Expand All @@ -271,6 +271,7 @@ public void testUpdateProcessVariable() throws Exception {
assertThatJson(responseNode)
.when(Option.IGNORING_EXTRA_FIELDS)
.isEqualTo("{"
+ " scope: 'global',"
+ " value: 'updatedValue'"
+ "}");

Expand All @@ -288,7 +289,7 @@ public void testUpdateProcessVariable() throws Exception {
}

@CmmnDeployment(resources = { "org/flowable/cmmn/rest/service/api/repository/oneHumanTaskCase.cmmn" })
public void testUpdateInstantProcessVariable() throws Exception {
public void testUpdateInstantCaseVariable() throws Exception {

Instant initial = Instant.parse("2019-12-03T12:32:45.583345Z");
Instant tenDaysLater = initial.plus(10, ChronoUnit.DAYS);
Expand Down Expand Up @@ -316,6 +317,7 @@ public void testUpdateInstantProcessVariable() throws Exception {
assertThatJson(responseNode)
.when(Option.IGNORING_EXTRA_FIELDS)
.isEqualTo("{"
+ " scope: 'global',"
+ " value: '2019-12-13T12:32:45.583Z'"
+ "}");
}
Expand Down Expand Up @@ -348,12 +350,13 @@ public void testUpdateLocalDateCaseVariable() throws Exception {
assertThatJson(responseNode)
.when(Option.IGNORING_EXTRA_FIELDS)
.isEqualTo("{"
+ " scope: 'global',"
+ " value: '2020-01-28'"
+ "}");
}

@CmmnDeployment(resources = { "org/flowable/cmmn/rest/service/api/repository/oneHumanTaskCase.cmmn" })
public void testUpdateLocalDateTimeProcessVariable() throws Exception {
public void testUpdateLocalDateTimeCaseVariable() throws Exception {

LocalDateTime initial = LocalDateTime.parse("2020-01-18T12:32:45");
LocalDateTime tenDaysLater = initial.plusDays(10);
Expand All @@ -380,6 +383,7 @@ public void testUpdateLocalDateTimeProcessVariable() throws Exception {
assertThatJson(responseNode)
.when(Option.IGNORING_EXTRA_FIELDS)
.isEqualTo("{"
+ " scope: 'global',"
+ " value: '2020-01-28T12:32:45'"
+ "}");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,7 @@ protected RestVariable setSimpleVariable(RestVariable restVariable, Execution ex
Object actualVariableValue = restResponseFactory.getVariableValue(restVariable);
setVariable(execution, restVariable.getName(), actualVariableValue, scope, isNew);

RestVariable variable = getVariableFromRequestWithoutAccessCheck(execution, restVariable.getName(), scope, false);
// We are setting the scope because the fetched variable does not always have it
variable.setVariableScope(scope);
return variable;
return getVariableFromRequestWithoutAccessCheck(execution, restVariable.getName(), scope, false);
}

protected void setVariable(Execution execution, String name, Object value, RestVariableScope scope, boolean isNew) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@ public void testUpdateProcessVariable() throws Exception {
assertThatJson(responseNode)
.when(Option.IGNORING_EXTRA_FIELDS)
.isEqualTo("{"
+ "scope: null,"
+ "value: 'updatedValue'"
+ "}");

Expand Down Expand Up @@ -342,6 +343,7 @@ public void testUpdateInstantProcessVariable() throws Exception {
assertThatJson(responseNode)
.when(Option.IGNORING_EXTRA_FIELDS)
.isEqualTo("{"
+ " scope: null,"
+ " value: '2019-12-13T12:32:45.583Z'"
+ "}");
}
Expand Down Expand Up @@ -374,6 +376,7 @@ public void testUpdateLocalDateProcessVariable() throws Exception {
assertThatJson(responseNode)
.when(Option.IGNORING_EXTRA_FIELDS)
.isEqualTo("{"
+ " scope: null,"
+ " value: '2020-01-28'"
+ "}");
}
Expand Down Expand Up @@ -407,6 +410,7 @@ public void testUpdateLocalDateTimeProcessVariable() throws Exception {
assertThatJson(responseNode)
.when(Option.IGNORING_EXTRA_FIELDS)
.isEqualTo("{"
+ " scope: null,"
+ " value: '2020-01-28T12:32:45'"
+ "}");
}
Expand Down

0 comments on commit 19e5c43

Please sign in to comment.