PLMPosKnowledgeIntegration Functions

PLMPosKnowledgeIntegration Functions

This page discusses:

GetCurrentDiscipline

Function used to return the current discipline name (set by the SetCurrentDiscipline function or using the Help > User Info dialog box.

Signature

GetCurrentDiscipline() : String

ReturnType

String

Example

set curDis = GetCurrentDiscipline()

GetResourceEntries

Function used to return a list of PLMIDs that identify the matching rows of the reference table.

Signature

GetResourceEntries(iRefTypeName : String, iWhereClause : String) : List

Arguments

NameInput / OutputRequired?TypeComment
iCustomTypeInYesStringName of the customized type that inherits PLMPosAbstractTableRef and represents the reference table being requested.
iWhereClauseInYesStringA "where" clause that allows to query only the matching rows of the reference table pertinent for the current business logic.

ReturnType

List

Example

Suppose 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:

PLMIDS = GetResourceEntries(“OrgWorkspaceTableRef”,”x.Org==’O1’ AND x.Access==’ReadWrite’”)

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.

GetTableType

Function 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.

Signature

GetTableType(iTable : Feature) : String

Arguments

NameInput / OutputRequired?TypeComment
iTableInYesFeature

ReturnType

String

Example

let EntityList (List)
let table (PLMPosProxyRef)
set table = AccessResource("PLMPosReferenceTablesResources|Resource1","")
if(table <> NULL) Set EntityList = GetResourceEntries(GetTableType(table), "x.E_Attribute1==\"XWZ*\"")

GetTableValues

Function used to return a list of strings which are the values of the requested attribute in the matching rows of the reference table.

Signature

GetTableValues(iRefTypeName : String, iAttNameList : List, iAttValueList : List) : List

Arguments

NameInput / OutputRequired?TypeComment
iRefTypeNameInYesString
iAttNameListInYesList
iAttValueListInYesList

ReturnType

List

Example

If 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);

SetCurrentDiscipline

Function 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.

Signature

SetCurrentDiscipline(iDiscipline : String) : String

Arguments

NameInput / OutputRequired?TypeComment
iDisciplineInYesString

ReturnType

String

Example

set 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.