Skip to content

Commit

Permalink
[408] Add missing 'element' variable for delete tools
Browse files Browse the repository at this point in the history
Bug: #408
Signed-off-by: Pierre-Charles David <pierre-charles.david@obeo.fr>
  • Loading branch information
pcdavid committed Mar 24, 2021
1 parent 94062cb commit a03e95a
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ public Function<VariableManager, Status> createDeleteToolHandler(DeleteElementDe
InitialOperation initialOperation = optionalInitialOperation.get();
return variableManager -> {
Map<String, Object> variables = variableManager.getVariables();
// Sirius Desktop Delete Tools expect an "element" variable to be available with the value
// of the initial invocation context (self).
variables.put("element", variables.get(VariableManager.SELF)); //$NON-NLS-1$
var modelOperationHandlerSwitch = this.modelOperationHandlerSwitchProvider.getModelOperationHandlerSwitch(this.interpreter);
return modelOperationHandlerSwitch.apply(initialOperation.getFirstModelOperations()).map(handler -> {
return handler.handle(variables);
Expand Down

0 comments on commit a03e95a

Please sign in to comment.