Description: BRM_RESOURCE_INVALID_ENTITY. The given entity reference or RQL expression is invalid. Error and the work item is sent to the undelivered queue. Here the user of the work item is assigned via a RQL. Symptoms: The following will lead to BRM_RESOURCE_INVALID_ENTITY. The given entity reference or RQL expression is invalid error. The work item will be sent to the undelivered queue.
1). If a RQL, like the one below, is used to determine the user to allocate the workitem:
User = Process.getOrgModelByVersion(x).positionByName(position).get(0).getGuid();
2). The organization model project, where the organization "position" is defined is not referenced by the process project.
3). There is another organization model in the same environment for which the major version was upgraded. No problem is seen when this org-model is at the same major version as other org-models in the environment. After the other organization model's major version is upgraded, the above RQL will fail with the error and the work items will be sent to undelivered queue. The following error can be seen in BPM.log :
...[amxbpm_wm_tp_3] [ERROR] com.tibco.n2.brm.model.util.DEDelegate - [ERROR] - {BRM_RESOURCE_INVALID_ENTITY} - Invalid validate entity ¬{extendedMessage=`The given entity reference or RQL expression is invalid: [null, _pAKmwK34EeWqN5hIdOK_6A]`
Cause: In the RQL, the process does not know which org-model to reference in "Process.getOrgModelByVersion". Therefore it uses the org-model with the greatest version to search for the GUID and fails. The process project should have a reference to the org-model project. This would normally be done automatically if any explicit reference is made by the process to an org-model entity. In this case, the org-model entity reference is via a script and is not considered explicit, hence the process object does not know which org-model to call.
Issue/Introduction
"BRM_RESOURCE_INVALID_ENTITY" error after organization model major version upgrade.
Resolution
In Business Studio, manually assign the org-model project reference using the "Properties / Project References" option. Right-click on the Process Project's root folder and select the "Properties" menu. In the properties dialog, select "Project References" and click the Org-Model containing the required org-model entities.