AreTreatedInSameTransactionChangeControlledStatusOn any reference or representation reference object, the ChangeControlledStatus knowledge function is available for the user to retrieve from a knowledge rule whether the object is Change Controlled or not: Boolean ChangeControlledStatus(Object Reference). Arguments
Note:
An error message appears, if the object is not a PLMReference or
PLMRepresentationReference.
ReturnTypeBoolean Examplelet iControlledStatus(Boolean)
iControlledStatus = ChangeControlledStatus(ThisObject)
Validation = true
if (iControlledStatus == false)
{ Validation = false
}
ChangeMaturityLets you change the maturity of a reference list or of a reference SignatureChangeMaturity(function: #In String, objects: #In ObjectType [, strSignature: #In String]) : VoidType Arguments
UsageChangeMaturity ("promote", MyReference, "Share")
ChangeMaturity ("demote", MyReference)
ReturnTypeBoolean Example 1let ListToChangeMaturity (List)
ListToChangeMaturity.Append( ThisObject )
ChangeMaturity("promote", ThisObject, "Share")
ChangeMaturity("demote", ThisObject )
ChangeMaturity("promote", ListToChangeMaturity, "Share")
GetAttachedDocumentsLets you retrieve aggregated documents from a reference. It returns a new list containing the identifiers of all the documents aggregated under the input reference. . Arguments
ReturnTypeList Example 1Parameters.NLSMessage = BuildKweMessageNLS(Catalog, Key, Arg1, Arg2, …) Example 2This example shows how to use a EKL script using GetAttachedDocuments() for thePLMCheckMaturity opening. The validation fails if at least one attached document has no description. Let ListDocs (List)
Let ListDocsSize (Integer)
Let doc (PLMCoreRepReference)
Set ListDocs = GetAttachedDocuments(ThisObject )
ListDocsSize = ListDocs.Size()
Trace (1, "nb docs : " + ListDocsSize)
Validation = true
i = 1
for i while i <= ListDocsSize
{
doc = ListDocs.GetItem(i)
Trace (1, "docs description: " + doc.V_description)
If ( doc.V_description == '' )
Validation = false
}
GetResourceEntriesFunctions that can be called in any server-side EKL opening: "Pre Check", "Action" or "Post Check" openings, and in any kind of operation already containing EKL openings (Save, Maturity, etc.), in the same way as any other EKL function. Arguments
ReturnTypeList Example
Let WhereClause(String)
Let EntityList (List)
Let CurrentEntity (PLMPosPickListRef)
Let i (Integer)
Let ListSize (Integer)
WhereClause = "x.PLM_ExternalID==\"TestResource*\" AND ( x.V_row_name==\"Row1\" OR x.V_row_name==\"Row2\" )"
Set EntityList = GetResourceEntries("PLMPosPickListRef", WhereClause)
if (EntityList <> NULL AND EntityList.Size() == 2)
{
for i while i <= ListSize
{
CurrentEntity = EntityList.GetItem(i)
if (CurrentEntity.V_row_data ...
}
Validation = true
}
else
{
Validation = false
}
GetSROwnersFromPointedElementReturns a list of all the PLM Entities that contain at least one semantic relation pointing to a given PLM Entity (parameter “pointedObject”) as target or in their path. Only
the semantic relations whose Role is contained in the input list of strings
Finally, only the PLM Entities who belong to the Designer Workspace
identified by the parameter SignatureGetSROwnersFromPointedElement(pointedObject : Feature, semanticRelRoles : List, workspaceid : String) : Boolean Arguments
ReturnTypePLMEntities ListImplementingChangesOn any object, the ListImplementingChanges Knowledge function will be available for the user to know by which ECA the objects has been impacted (if any): ListImplementingChanges(Object ). Arguments
ReturnTypeList Examplelet nbECAs(Integer)
let ListOfImplementingEca(List)
ListOfImplementingEca = ListImplementingChanges(ThisObject)
Validation = true
nbECAs = ListOfImplementingEca.Size()
if (nbECAs == 0)
{ Validation = false
}
RetrieveMaterialsFunction used to get the list of materials associated with a reference passed in input. Arguments
ReturnTypeList Example
let listMat(List)
let filteredtMat(List)
Validation = true
listMat = RetrieveMaterials(ThisObject)
filteredtMat = listMat.Filter("CATMatReference", "(x.IsASortOf(\"CATMatReferenceDS\") == true )
and (x.V_Density == 100 )")
if (filteredtMat.Size() > 0)
Validation = false
SetChangeControlledStatusOn any reference or representation reference object, the SetChangeControlledStatus knowledge function is available so that you can valuate the Change Controlled status when executing the rule: SetChangeControlledStatus(Object Reference, Boolean ChangeControlledStatus). ReturnTypeBoolean Examplelet DescriptionValue(String)
DescriptionValue=ThisObject.V_description
if (DescriptionValue=="PhaseB")
{
SetChangeControlledStatus(ThisObject,true)
}
TraceThe trace action is listed below. Syntax
To activate Traces:
This file must have the following format: <configuration ... >
<!-- logback.xml -->
<appender name="STDOUT"
class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d [%thread] %-5level %logger{15} - %msg%n</pattern>
</encoder>
</appender>
<!-- basic traces --> <logger name="CKE_CUSTO_TRACES" level="DEBUG"><appender-ref ref="STDOUT"/></logger>
<!-- extended traces <logger name="CKE_CUSTO_TRACES_Verbose" level="DEBUG"><appender-ref ref="STDOUT"/></logger> --> <root level="OFF"/> </configuration>
The text provided to the Trace() function is displayed on the server side in the application server console. You can also display it through the logger name CKE_EKL_TRACE in debug mode, for example: <logger name="CKE_EKL_TRACE" level="DEBUG"><appender-ref ref="STDOUT"/></logger>. The traces are only used for debug purposes. Arguments
Example 1
BuildDeferredMessageNLSCATNls file depending on the client NLS on a target machine. Its role is to store the information to build a message (could be error, warning, or info) from a catalog, key, and inputs arguments.The BuildDeferredMessageNLS function can build an NLS message (a message in a given language) by finding it in a CATXXX.
Arguments
The output is a structure composed of Catalog, Key, and List of arguments, that is to be affected to Parameters. Note:
The BuildMessageNLS on the client is replaced by a
BuildDeferredMessageNLS on the server. The CATNls files must be available on the
client.
Example 1Parameters.NLSMessage =
BuildKweMessageNLS(Catalog, Key, Arg1, Arg2, …)ValidateSRsIn a completion scenario, navigation is performed through basic PLMQL calls. The navigation returns paths that become filters according to semantic relations’ roles or pointed objects’ types. This function is used to allow the user to filter inputs by performing an efficient navigation, including filter parameters. SignatureValidateSRs(iObjectToCheckPLMIDs, iRoles, iScopePLMIDs, iExcludedTypes) Arguments
ReturnTypeList of strings ExampleLet validatedConnections (PLMIDSet) set validatedConnections = ValidateSRs( inputConnections, RolesList, scopesObjects, excludedTypes)
In the above example:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||