Skip to content

Commit

Permalink
Merge pull request #2 from OpenTOSCA/fix/restextension
Browse files Browse the repository at this point in the history
fixes REST extension to not only replace a single variable reference
  • Loading branch information
wederbn authored Aug 15, 2019
2 parents dd27e18 + 716e39d commit 6a3bbce
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -263,13 +263,13 @@ public static String resolveVariableValueReference(ExtensionContext context,

// Check if a concrete variable name ("varName") or a reference to the value of
// a variable is specified ("$bpelVar[varName]")
if (variableValueReference.contains(VARIABLE_VALUE_REFERENCE)) {
int startIndexOfVarReference = variableValueReference.indexOf(VARIABLE_VALUE_REFERENCE);
int endIndexOfVarReference = variableValueReference.indexOf("]");
while (variableValue.contains(VARIABLE_VALUE_REFERENCE)) {
int startIndexOfVarReference = variableValue.indexOf(VARIABLE_VALUE_REFERENCE);
int endIndexOfVarReference = variableValue.indexOf("]");

String variableName = variableValueReference.substring(startIndexOfVarReference + VARIABLE_VALUE_REFERENCE.length(), endIndexOfVarReference);
String variableName = variableValue.substring(startIndexOfVarReference + VARIABLE_VALUE_REFERENCE.length(), endIndexOfVarReference);

String prefix = variableValueReference.startsWith(VARIABLE_VALUE_REFERENCE) ? "" : variableValue.substring(0, startIndexOfVarReference);
String prefix = variableValue.startsWith(VARIABLE_VALUE_REFERENCE) ? "" : variableValue.substring(0, startIndexOfVarReference);
String suffix = variableValue.length() > endIndexOfVarReference + 1 ? variableValue.substring(endIndexOfVarReference + 1) : "";

Variable variable = context.getVisibleVariables().get(variableName);
Expand Down

0 comments on commit 6a3bbce

Please sign in to comment.