Context Object Parameters
Parameter Name |
Type |
Read/Write |
Comments |
DefaultTargetTypeName |
String |
Read |
Name of the default target type used to perform the query or the
filter, instead of using the customized former typing type that was previously
defined in the persistent query. For example, if the query was done on a
customization of VPMReference , it is now
VPMReference . |
PreviousAttributes |
List |
Read |
List of the customized attribute names that were used in the
PVS. |
ComputedTargetTypeName |
String |
Write |
Parameter used to precise a unified typing specialization type,
if the migration consisted in migrating all objects of the customized type (former
typing) to objects of this specialization type. Note:
You can leave this parameter
empty if all objects have been migrated using the
DefaultTargetTypeName parameter.
|
MappedAttributes |
List of strings |
Write |
Output list whose size should be identical to the
PreviousAttributes parameter size. It should contain the new
names of the attributes. If an attribute is lost, enter an empty name. |
MappedExtensions |
List of strings |
Write |
Output list whose size should be identical to the the
PreviousAttributes parameter size. It should contain the name of
the extension type where the attribute has been migrated. If the attribute is not
defined on an extension, but on the specialized type, enter an empty name. |
Sample
The following sample shows how to use this opening.
Let’s imagine that in the former typing customization, the customized type is
PLMProductDS
. This type has three string attributes
(V_StdNumber
, V_IndustryCode
, V_BOM
).
In the unified typing customization, objects of such a type have been migrated to a
specialized type SpecializedProductReference
. This type has an
attribute V_StdNumber2
, extended by an extension
DeplExtForIndustryCode2
. This extension has the V_
IndustryCode2
attribute.
The business rule below describes that StdNumber
is mapped to
V_StdNumber2
and V_IndustryCode
to
V_IndustryCode2
, and that V_BOM
is forgotten in the
process.
/* Be sure that VPM Reference is set */
let x=""
let listeInput(List)
let listeOutput(List)
let listeExtensionsOutput(List)
let nameAttribute=""
x = Parameters->GetAttributeString("DefaultTargetTypeName")
if (x=="VPMReference")
{
/* you get the input list */
set listeInput = Parameters->GetAttributeObject("PreviousAttributes")
for nameAttribute inside listeInput
{
if (nameAttribute=="V_StdNumber")
{
listeOutput->Append("V_StdNumber2")
listeExtensionsOutput->Append("")
}
else if (nameAttribute=="V_IndustryCode")
{
listeOutput->Append("V_IndustryCode2")
listeExtensionsOutput->Append("DeplExtForIndustryCode2")
}
else if (nameAttribute=="V_BOM")
{
listeOutput->Append("")
listeExtensionsOutput->Append("")
}
}
/* The outputs are valuated*/
Parameters->SetAttributeString("ComputedTargetTypeName","SpecializedProductReference")
Parameters->SetAttributeObject("MappedAttributes",listeOutput)
Parameters->SetAttributeObject("MappedExtensions",listeExtensionsOutput)
}