GetCurrentDisciplineGetResourceEntriesFunction used to return a list of PLMIDs that identify the matching rows of the reference table. Arguments
ReturnTypeList ExampleSuppose the customized type is “OrgWorkspaceTableRef”. Three customized attributes have been defined for this type and the first two are parts of the identifier set: Org, Workspace, and Access. This reference table’s purpose is to store the access (Access: ReadOnly/ReadWrite) for each organization (Org) on each workspace (Workspace). Rows of this table look like this: Imagine the BL requires that we get the list of workspaces for which the access is ReadWrite for the current login organization O1. The function can be used like this:
The where clause can be built dynamically but it is just given here as a sample. In PLMIDS we will retrieve the PLMID of the following 2 rows matching the criteria: O1 WKSP-2 ReadWrite O1 WKSP-3 ReadWrite The where clause supports the OR and AND operators and only == for the attributes values (the wild character “*” can be used in the values however). The object attribute should be represented by x.attribute as shown in the example. GetTableTypeFunction used to return in output the customized type of the table returned by the AccessResource function. This type is used as first argument of the GetResourceEntries and GetTableValues function. Arguments
ReturnTypeString Examplelet EntityList (List) let table (PLMPosProxyRef) set table = AccessResource("PLMPosReferenceTablesResources|Resource1","") if(table <> NULL) Set EntityList = GetResourceEntries(GetTableType(table), "x.E_Attribute1==\"XWZ*\"") GetTableValuesFunction used to return a list of strings which are the values of the requested attribute in the matching rows of the reference table. Arguments
ReturnTypeList ExampleIf you want to directly access the workspace names (and not the PLMID of the rows) we can use GetTableValues instead: Names ->Append("Workspace") Values ->Append("*") Names ->Append("Org") Values ->Append("O1") Names ->Append("Access") Values ->Append("ReadWrite") Workspaces = GetResourceEntries(“OrgWorkspaceTableRef”,Names,Values); In Workspaces we will have two strings: WKSP-2 and WKSP-3. Note:
The first value containing * corresponds to the attribute name Workspace, hence indicating that you want the workspace names in the output. (name,value) couples are ANDed in the resulting where clause and if an attribute appears several times its values are ORed in the resulting where clause.
Names ->Append("Workspace") Values ->Append("*") Names ->Append("Org") Values ->Append("O1") Names ->Append("Org") Values ->Append("O2") Names ->Append("Access") Values ->Append("ReadWrite") Workspaces = GetResourceEntries(“OrgWorkspaceTableRef”,Names,Values); SetCurrentDisciplineFunction used to set the discipline whose name is given in argument on the current session. The function returns the name if everything is ok. These disciplines are managed by the P&O administration web console or the P&O import tool. To find out more, see the VPM Multi-Discipline Collaboration Platform - Installation User's Guide: Authoring People, Organization and Security Data. Arguments
ReturnTypeString Exampleset curDis = SetCurrentDiscipline(« Piping ») In the above example, the Piping discipline is the current one in session which means that the Business Logics and Resources attached to this discipline in the Data set-up app are taken into account at runtime. |