Returns all the variables defined for the current context. If @contextId is defined then the variables defined for the associated context (if valid) are returned. If no such context exists then null is returned.