Context Object Parameters
Parameter Name | Type | Read/Write | Comments |
---|
iServiceItemFatherReference
| Object | Read | Service Item reference that will be the father of the returned service
item |
iListOfScopingServiceItems
|
List |
Read |
List of the Service Items' references scoping the
product or part on which the business logic is invoked. |
oServiceItemReference |
Object |
Write |
Reference of the Service Item to use.
May be NULL .
|
oServiceItemType |
String |
Write |
Type of the Service Item to create, if a
oServiceItemReference is not returned.May be:
"DELServiceAssemblyReference" for
Service Assembly
"DELServicePartReference" for Service
Part
"DELServiceKitReference" for Service
Kit
|
oServiceItemMagnitude
|
Integer |
Write |
Magnitude of the Service Item to create, if a
oServiceItemReference is not returned.
Note:
Only required if the type is a sort of continuous.
May be:
0 : Each (not continuous Service Item)
1 : Length
2 : Weight
3 : Surface
4 : Volume
|
oCreateScope |
Integer |
Write |
Specifies if a scope has to be created or not.
Note:
Only required if the business logic returns a type to
create.
May be:
0 : Does not create a scope
1 : Creates a scope
-1 : Applies the Create Item-Product
Scope on automatically created Service
Part option.
|
Sample
The following sample retrieves the Service Item reference to use for a given product from a list
of scoping Service Items.
/*
Name : DELMIA_GetServiceItemReferenceToUseFromScopingItems_ID
Mode : Execution
Function : Opening run to retrieve the Service Item Reference to use for a given product from a list of scoping Service Items
Arguments :
ThisObject = Product or Part on which the test is done
iListOfScopingServiceItems (IN) = ListType, list of the Service Items references scoping the Product or Part on which the BL is invoked
iServiceItemFatherReference (IN) = ObjectType, Service Items reference that will be the father of the returned Service Item
oServiceItemReference (OUT) = ObjectType, reference of Service Item to use (may be NULL)
oServiceItemType (OUT) = String, type of the ServiceItem to create, if a oServiceItemReference is not returned
Authorized values :
"DELServiceAssemblyReference" for Service Assembly
"DELServicePartReference" for Service Part
"DELServiceKitReference" for Service Kit
Any specialized type deriving from those OOTB types is allowed.
oServiceItemMagnitude (OUT) = Integer, magnitude of the ServiceItem to create, if a oServiceItemReference is not returned (only required if the type is a sort of continuous)
Authorized values :
0 : Each (not continuous item)
1 : Length
2 : Weight
3 : Surface
4 : Volume
*/
let ThisRef(VPMReference)
Let oServiceItemReference(DELFmiFunctionReference)
Let iServiceItemFatherReference(DELFmiFunctionReference)
Let iListOfScopingServiceItems(List)
Let oServiceItemType(String)
Let oServiceItemMagnitude(Integer)
Let NbOfScopingItems(Integer)
Let FatherDesc(String)
Let index(Integer)
Let ItemReference(DELFmiFunctionReference)
Let ItemDesc(String)
set ThisRef = ThisObject.Reference
oServiceItemReference = NULL
/*Read the scoping items */
set iListOfScopingServiceItems = Parameters->GetAttributeObject("iListOfScopingServiceItems")
set NbOfScopingItems = iListOfScopingServiceItems.Size()
Trace(1 , "NbOfScopingItems : ", NbOfScopingItems )
if (NbOfScopingItems > 0)
{
/* Read father item */
set iServiceItemFatherReference = Parameters->GetAttributeObject("iServiceItemFatherReference")
if (iServiceItemFatherReference <> NULL)
{
set FatherDesc = iServiceItemFatherReference->GetAttributeString("V_description")
Trace(1 , "FatherDesc : ", FatherDesc )
}
index = 0
for index while index < NbOfScopingItems
{
index = index+1
set ItemReference = iListOfScopingServiceItems.GetItem(index)
if (ItemReference <> NULL)
{
set ItemDesc = ItemReference->GetAttributeString("V_description")
Trace(1 , "ItemDesc : ", ItemDesc )
if (ItemDesc == FatherDesc)
{
set oServiceItemReference = ItemReference
}
}
}
}
Parameters.SetAttributeObject("oServiceItemReference" , oServiceItemReference)
if (oServiceItemReference == NULL)
{
Trace(1 , "oServiceItemType : ", oServiceItemType )
oServiceItemType = "DELServicePartReference"
oServiceItemMagnitude = 0
Parameters.SetAttributeString("oServiceItemType" , oServiceItemType)
Parameters.SetAttributeInteger("oServiceItemMagnitude" , oServiceItemMagnitude)
}