protected void addLocalVariables(
      Execution execution,
      int variableType,
      Map<String, RestVariable> variableMap,
      UriInfo uriInfo) {
    RuntimeService runtimeService = BPMNOSGIService.getRumtimeService();
    Map<String, Object> rawLocalvariables = runtimeService.getVariablesLocal(execution.getId());
    List<RestVariable> localVariables =
        new RestResponseFactory()
            .createRestVariables(
                rawLocalvariables,
                execution.getId(),
                variableType,
                RestVariable.RestVariableScope.LOCAL,
                uriInfo.getBaseUri().toString());

    for (RestVariable var : localVariables) {
      variableMap.put(var.getName(), var);
    }
  }
 public void deleteAllLocalVariables(Execution execution) {
   RuntimeService runtimeService = BPMNOSGIService.getRumtimeService();
   Collection<String> currentVariables =
       runtimeService.getVariablesLocal(execution.getId()).keySet();
   runtimeService.removeVariablesLocal(execution.getId(), currentVariables);
 }