Context Object Parameters
Parameter Name | Type | Read/Write | Comments |
---|
iTarget | MfgProcessOccurrence | Read | Occurrence of the target (that is, the new parent of the moved item). |
Validation | Boolean |
Write | Checks if the item can be moved. |
Sample
The following sample checks if an item can be moved.
Let iProcess(MfgProcessOccurrence)
Let iTarget(MfgProcessOccurrence)
Let AttValue(String)
Let ProcessInstance(DELFmiFunctionInstance)
Let TargetInstance(DELFmiFunctionInstance)
Let ProcessName(String)
Let TargetName(String)
Let ProcessTest(String)
Let TargetTest(String)
Let ReturnMessage(String)
Validation = true
ReturnMessage =""
set iProcess = ThisObject
if ( NULL <> iProcess)
{
set iTarget = Parameters->GetAttributeObject("iTarget")
set TargetInstance = iTarget.Instance
if (TargetInstance <> NULL )
{
TargetName = TargetInstance->GetAttributeString("PLM_ExternalID")
TargetTest=TargetName.Extract(0,3)
}
set ProcessInstance = iProcess.Instance
if (ProcessInstance <> NULL )
{
ProcessName = ProcessInstance->GetAttributeString("PLM_ExternalID")
ProcessTest=ProcessName.Extract(0,3)
if (ProcessTest <> "Yes" OR TargetTest <> "Yes")
{
Validation = false
ReturnMessage = "The business logic does not allow reparent of "+ProcessName+ " on " + TargetName
}
}
}
Parameters.SetAttributeString("Message",ReturnMessage)