The following EKL script uses functions to check the maturity change of a system.
Let process_scopes(List)
Let process_reference(DELFmiFunctionReference)
Let system_reference(DELLmiProductionSystemReference)
Let resource_scopes(List)
Let resource_reference(VPMReference)
Let resource_instance(VPMInstance)
Let scope_resource_reference(VPMReference)
Let system_or_op_instance(PLMCoreInstance)
Let ListChildren(List)
Let operation_occurrence(List)
Let localization_resource_occurrence(List)
Let executing_resource_occurrence(List)
Let used_resource_occurrences(List)
Let used_resource_occurrence(List)
Let ListSize(Integer)
Let index(Integer)
Validation = true
/*************************/
/* Verify process scopes */
/*************************/
process_scopes = GetProcessScopesFromSystem(ThisObject)
ListSize = process_scopes.Size()
Trace (1, "Process_Scopes_Size = " + ListSize)
if (ListSize <> 2)
{
Validation = false
}
index=0
for index while index < ListSize
{
index = index + 1
process_reference = process_scopes.GetItem(index)
Trace (1, "PLM_ExternalID=", process_reference.PLM_ExternalID)
}
/**************************/
/* Verify resource scopes */
/**************************/
resource_scopes = GetResourceScopes(ThisObject)
ListSize = resource_scopes.Size()
Trace (1, "Resource_Scopes_Size = " + ListSize)
if (ListSize <> 2)
{
Validation = false
}
index=0
for index while index < ListSize
{
index = index + 1
resource_reference = resource_scopes.GetItem(index)
Trace (1, "PLM_ExternalID=", resource_reference.PLM_ExternalID)
if (resource_reference.PLM_ExternalID == "Organizational73")
{
scope_resource_reference = resource_reference
}
}
/***********************************/
/* Initialize Operation Occurrence */
/***********************************/
ListChildren = ThisObject.Children
ListSize = ListChildren.Size()
if (ListSize <> 1)
{
Validation = false
}
system_or_op_instance = ListChildren.GetItem(1)
operation_occurrence.Append(system_or_op_instance)
ListChildren = system_or_op_instance.Children
ListSize = ListChildren.Size()
if (ListSize <> 1)
{
Validation = false
}
system_reference = ListChildren.GetItem(1)
ListChildren = system_reference.Children
ListSize = ListChildren.Size()
if (ListSize <> 1)
{
Validation = false
}
system_or_op_instance = ListChildren.GetItem(1)
operation_occurrence.Append(system_or_op_instance)
/***************************/
/* Verify "where" resource */
/***************************/
localization_resource_occurrence = GetLocalizationResource(scope_resource_reference,operation_occurrence)
ListSize = localization_resource_occurrence.Size()
Trace (1, "Depth of Localization Resource Occurrence = " + ListSize)
if (ListSize <> 1)
{
Validation = false
}
index=0
for index while index < ListSize
{
index = index + 1
resource_instance = localization_resource_occurrence.GetItem(index)
Trace (1, "PLM_ExternalID=",
resource_instance.PLM_ExternalID)
}
/*************************/
/* Verify "who" resource */
/*************************/
executing_resource_occurrence =
GetExecutingResource(scope_resource_reference,operation_occurrence)
ListSize = executing_resource_occurrence.Size()
Trace (1, "Depth of Executing Resource Occurrence = " + ListSize)
if (ListSize <> 2)
{
Validation = false
}
index=0
for index while index < ListSize
{
index = index + 1
resource_instance = executing_resource_occurrence.GetItem(index)
Trace (1, "PLM_ExternalID=", resource_instance.PLM_ExternalID)
}
/***************************/
/* Verify "with" resources */
/***************************/
used_resource_occurrences = GetUsedResources(scope_resource_reference, operation_occurrence)
ListSize = used_resource_occurrences.Size()
Trace (1, "Number of Used Resources = " + ListSize)
if (ListSize <> 1)
{
Validation = false
}
used_resource_occurrence = used_resource_occurrences.GetItem(1)
ListSize = used_resource_occurrence.Size()
Trace (1, "Depth of Used Resource Occurrence = " + ListSize)
if (ListSize <> 2)
{
Validation = false
}
index=0
for index while index < ListSize
{
index = index + 1
resource_instance = used_resource_occurrence.GetItem(index)
Trace (1, "PLM_ExternalID=", resource_instance.PLM_ExternalID)
}
/*************************************************/
/* Verify implemented object for "with" resource */
/*************************************************/
operation_occurrence = GetImplementedObjectFromResource(ThisObject, used_resource_occurrence)
ListSize = operation_occurrence.Size()
Trace (1, "with: Depth of Operation Occurrence = " + ListSize)
if (ListSize <> 2)
{
Validation = false
}
index=0
for index while index < ListSize
{
index = index + 1
system_or_op_instance = operation_occurrence.GetItem(index)
Trace (1, "PLM_ExternalID=", system_or_op_instance.PLM_ExternalID)
}
/************************************************/
/* Verify implemented object for "who" resource */
/************************************************/
operation_occurrence = GetImplementedObjectFromResource(ThisObject, executing_resource_occurrence)
ListSize = operation_occurrence.Size()
Trace (1, "who: Depth of Operation Occurrence = " + ListSize)
if (ListSize <> 2)
{
Validation = false
}
index=0
for index while index < ListSize
{
index = index + 1
system_or_op_instance = operation_occurrence.GetItem(index)
Trace (1, "PLM_ExternalID=", system_or_op_instance.PLM_ExternalID)
}
/*************************************************/
/* Verify implemented object for "where" resource */
/*************************************************/
operation_occurrence = GetImplementedObjectFromResource(ThisObject, localization_resource_occurrence)
ListSize = operation_occurrence.Size()
Trace (1, "where: Depth of Operation Occurrence = " + ListSize)
if (ListSize <> 2)
{
Validation = false
}
index=0
for index while index < ListSize
{
index = index + 1
system_or_op_instance = operation_occurrence.GetItem(index)
Trace (1, "PLM_ExternalID=", system_or_op_instance.PLM_ExternalID)
}