Context Object Parameters (in addition to standard message and Severity parameters for validation BL)
For Documents Attached to ObjectsParameter Names | Types | Read/Write | Comments |
---|
Target | PLMDMTDocument | Read | Parameter in input that contains the target object of the relation to be suppressed, i.e. the document. |
RelationType | String | Read | String parameter in input of the rule. In this case, its value is PLMDocConnection. |
Policy | String | Read | Policy name. |
Note:
Attributes of both the input object and the target are available in the Business Logic and can be used to determine the check validity. The attribute that can prove useful is the current state.
For Documents Inserted into a FolderParameter Names | Types | Read/Write | Comments |
---|
Target | PLMCoreReference PLMCoreRepReference | Read | Parameter in input that contains the target object of the relation to be suppressed, i.e. the object being inserted. |
RelationType | String | Read | String parameter in input of the rule. In this case, its value is PLMFolderConnection. |
Policy | String | Read | Policy name. |
Note:
This works both with folders and workspace vaults.
Sample
The following sample shows how to check some attributes values (e.g. V_description) of the product to which the document is detached.
If (ThisObject.V_description == "Test")
{
validation = TRUE
}
else
{
validation = FALSE
}
if (validation == FALSE)
{
Parameters.Message = "Cannot attach the document under the Product"
Parameters.Severity=2
}
For Documents Inserted into a Folder
The following BL sample shows how to check some attributes values (e.g. V_description) of the object attached under the folder.
Let FolderReference(PLMCoreReference)
Let ObjectReference(PLMEntity)
Let FolderReferenceDescription(String)
Let ObjectDescription(String)
set FolderReferenceDescription = ThisObject.V_description
if(true==Parameters->HasAttribute("Target"))
{
set ObjectReference = Parameters->GetAttributeObject("Target")
}
if(true==ObjectReference->HasAttribute("V_description"))
{
set ObjectDescription = ObjectReference->GetAttributeString("V_description")
}
if (ObjectDescription==FolderReferenceDescription)
{
Validation = true
}
else
{
Validation = false
}
if (Validation == false)
{
Parameters.Message = "Cannot insert the Object under the Folder"
Parameters.Severity=2
}