-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(engine): fix storing parameter types in expression resolving
add test case for method expression evaluation with 2 params of the same type Related to CAM-14916, Closes PR #2029 Co-authored-by: tasso94 <3015690+tasso94@users.noreply.github.com>
- Loading branch information
1 parent
cea79ea
commit aece373
Showing
4 changed files
with
110 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
engine/src/test/java/org/camunda/bpm/engine/test/bpmn/el/ExpressionTestParameter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* 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.bpmn.el; | ||
|
||
import java.io.Serializable; | ||
|
||
/** | ||
* Class used to test resolving method parameters | ||
*/ | ||
public class ExpressionTestParameter implements Serializable { | ||
|
||
protected static final long serialVersionUID = 1L; | ||
|
||
public boolean testMethod(String param1) { | ||
return false; | ||
} | ||
|
||
public boolean testMethod(String param1, Object param2) { | ||
return false; | ||
} | ||
|
||
// first service task | ||
public boolean testMethod(String param1, String param2) { | ||
return true; | ||
} | ||
|
||
// second service task | ||
public String testMethod(String param1, String param2, String param3) { | ||
return param3; | ||
} | ||
|
||
} |
23 changes: 23 additions & 0 deletions
23
...mn/el/ExpressionManagerTest.shouldResolveMethodExpressionTwoParametersSameType.bpmn20.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<definitions | ||
xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" | ||
xmlns:camunda="http://camunda.org/schema/1.0/bpmn" | ||
targetNamespace="Examples"> | ||
|
||
<process id="process" name="Test method expression with two params same type" isExecutable="true"> | ||
|
||
<startEvent id="theStart" /> | ||
<sequenceFlow id="flow1" sourceRef="theStart" targetRef="servicetask1" /> | ||
<serviceTask id="servicetask1" name="ServiceTask 1" | ||
camunda:expression="${execution.setVariable('task1Var',myVar.testMethod('invoiceNumber','NO-123'))}" /> | ||
<sequenceFlow id="flow2" sourceRef="servicetask1" targetRef="servicetask2" /> | ||
<serviceTask id="servicetask2" name="ServiceTask 2" | ||
camunda:expression="${execution.setVariable('task2Var',myVar.testMethod('invoiceNumber','NO-123','lastParam'))}" /> | ||
<sequenceFlow id="flow3" sourceRef="servicetask2" targetRef="userTask" /> | ||
<userTask id="userTask" /> | ||
<sequenceFlow id="flow4" sourceRef="userTask" targetRef="theEnd" /> | ||
<endEvent id="theEnd" /> | ||
|
||
</process> | ||
|
||
</definitions> |