As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
Map<String, Object> properties = ((DelegateExecution) getRuntimeService().createExecutionQuery().processInstanceId(processInstanceId).singleResult()).getVariables();
DelegateExecution is the only impl for Execution, so the cast itself is safe for now. The problem is that no one assures you that in term of business logic it is safe