PLM Business Logic for Validation of Replace by New Version Document

This article details how to define and integrate the Replace By Version Check Business Logic based on the knowledge scripting technology.

Note: For more information about customization by business rules, see Installation and Setup: Customize: Behavior: Data Setup: Customization by Business Rules.

This page discusses:

Business Logic Intent

The PLMReplaceByVersionCheck Business Logic (BL) is called on CBP or VPM documents under VPMReference each time the user wants to replace the version of documents. This operation involves the type, attribute values and lifecycle state of the object on which the document is attached. The goal of the BL is to check that coherency rules are compliant with the authorization rules.

You can invoke this BL in the following ways:

  • For a document of information, the replace to a reference is possible whatever be the maturity of the reference (even if the reference is frozen).
  • For a document of definition, the replace to a reference is possible for authorized only provided the maturity of the reference is not frozen.

The business logic behavior is illustrated below:

PLM Opening Definition

This section describes the objects defining the opening: its global information, its kind of input object, its context object parameters.

General Information

The table below provides you with information related to the definition of the Opening ID:

Opening ID: PLMReplaceByVersionCheck
Customization intent: Validation
Execution context:Client

Input Objects

The Business Logic can be invoked for at least the listed Component Type. It means that your implementation can safely use the attributes of the default Component. Input objects must be of the following types:

Component Class Types
PLMCoreReference
PLMCoreRepReference

Context Object Parameters

Parameter NameTypeRead/WriteComments
Message String Read Parameter used to validate the Business Logic (BL). This parameter

explains why the BL decides to invalidate the operation.

Severity Integer Read Parameter used to validate the Business Logic (BL). This parameter

explains the severity of the error. If the value is 1, the operation is not interrupted. It is just a warning. If the value is greater than 1, the operation is invalid.

RelationType String Read Input parameter which contains the value of the document.
TargetString Read Input parameter which contains the target object of the relation that we want to create.

Sample

The following sample illustrate how to check the version of the document to be attached to the product. To achieve this particular business logic implementation you will associate a script (e.g. "PLMReplaceByVersionCheck") to the couple (OpeningID, Type) in a CATRuleExit file:

 <Scripts>
	     <Script OpeningID="PLMReplaceByVersionCheck" Type="PLMEntity" ScriptName="BLForDocument_Maturity-DOC"/>
 </Scripts>

Then you will create a CATRule file (e.g.BLForDocument_Maturity-DOC.CATRule) to define your business logic:

 if(ThisObject.V_description == "information")
 {
     Validation = FALSE
 }
 else
 {
     Validation = TRUE
 }

 if (Validation == FALSE)
 {
	    Parameters.Message = "Cannot Replace the Object Under the folder"
     Parameters.Severity=2
 }