Context Object Parameters
Parameter Name | Type | Read/Write | Comments |
---|
Source | List |
Read | List of size 1 including a DELLmiPPRSystemReference or DELLmiOperationPPRReference |
Target | List | Read | List of size 1 including a DELLmiOperationPPRReference |
RelationType | String | Read | Its value is OperationPPRInstance |
RelationObject | ObjectType | Read | Set with a DELLmiOperationPPRInstance |
Sample
The following sample shows how to use the opening ID to create a product flow between an existing operation and the created operation instance, and then create a time analysis under the operation instance.
// Parameters
let PointingObjSystemOperation(List)
let PointedObjOperation(List)
let RelationName(String)
let OpInstance(DELLmiOperationPPRInstance)
let RepInstTimeAnalysisToCreate(DELTimeAnalysisRepInstance)
let SubsystemValue(String)
let OperationInstance(DELLmiOperationPPRInstance)
let TimeConstraintAsTarget(DELLmiTimeConstraintCnx)
let CurrentOperation(DELLmiOperationPPRInstance)
let ChildrenOperationList(List)
let CurentOperationList(List)
let Integ(Integer)
let NbOpInst(integer)
let OperationReference(DELLmiOperationPPRReference)
let FatherSystemOperation(DELLmiPPRSystemReference)
let PointedObjOperationInst(List)
set PointingObjSystemOperation = Parameters->GetAttributeObject("Source")
set PointedObjOperation = Parameters->GetAttributeObject("Target")
set RelationName = Parameters->GetAttributeString("RelationType")
set OpInstance = Parameters->GetAttributeObject("RelationObject")
// get the operation Ref from param
OperationReference = PointedObjOperation.GetItem(1)
// create the TA under the Operation
If (OperationReference <> NULL)
{
if (RelationName == "OperationPPRInstance")
{
If (OperationReference <> NULL )
{
SubsystemValue = OperationReference.V_Subsystem
set RepInstTimeAnalysisToCreate = new("DELTimeAnalysisRepReference","test",OperationReference)
}
}
}
// get the sister Operations
Set FatherSystemOperation = PointingObjSystemOperation.GetItem(1)
set ChildrenOperationList = FatherSystemOperation.Children
// take the first operation that doesn't have a target Time constraint
set Integ = 1
for Integ while Integ < ChildrenOperationList.Size()
{
set CurrentOperation = ChildrenOperationList.GetItem(Integ)
if (OpInstance <> CurrentOperation)
{
CurentOperationList.RemoveAll()
CurentOperationList.AddItem(CurrentOperation, 0)
set TimeConstraintAsTarget = GetPointedAsTargetTimeConstraintsList(CurentOperationList)
if (TimeConstraintAsTarget == NULL)
{
break
}
else
{
CurentOperationList.RemoveAll()
}
}
Integ = Integ + 1
}
// create a product flow betwen this operation and the newly created one
if (CurentOperationList.Size() > 0)
{
PointedObjOperationInst.AddItem(OpInstance, 0)
CreateTimeConstraint(CurentOperationList,PointedObjOperationInst)
}