Authorize Drag and Drop In Planning Applications (DELMIA_DragDrop_Authorization_ID)

An opening ID is an entry point used to customize business logic. This opening ID defines the wanted behavior when dropping a PPR object on another PPR object.

Note: For more information about customization by business rules, see Installation and Setup: Customize: Behavior: Data Setup: Customization by Business Rules.

This page discusses:

General Information

This opening ID is invoked at the drop of a PPR object on another PPR object.

This opening ID is used to customize the wanted behavior when dropping a PPR object on another PPR object: Should the drag and drop be allowed in the current application?

The table below provides you with information related to the definition of the opening ID.

Definition Description
PLM Opening ID DELMIA_DragDrop_Authorization_ID
Customization intent Execution
Execution context Client

Input Objects

Input objects must be of the following type:

  • ThisObject: item, system, or operation reference. This is the reference type of the target drop occurrence: iTargetOcc.
  • Parameters corresponds to the context object.

Context Object Parameters

Parameter Name Type Read or Write Comments
iListSourceOcc List Write List of dragged object occurrences.
iTargetOcc Feature Write Target drop occurrence.
iWorkbenchName String Write Name of the current application.
oIsAuthorized Boolean Read If TRUE, then the drag and drop are allowed.

If FALSE, the drag and drop is forbidden and the output message will be displayed.

oMessage String Read The output message to display if the drag & drop is not allowed.
iCtrlKeyPressed Boolean Write If TRUE, the Ctrl key is considered as pressed during the drag and drop.

If FALSE, the Ctrl key is not considered as pressed during the drag and drop.

iShiftKeyPressed Boolean Write If TRUE, the Shift key is considered as pressed during the drag and drop.

If FALSE, the Shift key is considered as pressed during the drag and drop.

Sample

The following sample shows how to use the opening ID.

/* INPUTS DEFINITION*/
Let iLstSourceOccurrences(List)
Let iTargetOccurrence(Feature)
Let iWorkbenchName(String)

/* OUTPUTS DEFINITION*/
Let oIsAuthorized(Boolean)
Let oMessage(String)

Let TargetReference(PLMCoreReference)
Let NbSource(Integer)
Let Index(Integer)
Let CurProdResSourceOcc(ProductOccurrence)
Let CurProcessSourceOcc(MfgProcessOccurrence)
Let CurSysOpeSourceOcc(ProdSystemOccurrence)
Let CurrentSourceRef(PLMCoreReference)

/* RETRIEVE INPUT PARAMETERS*/
if ( true == Parameters.HasAttribute("iListSourceOcc"))
	set iLstSourceOccurrences= Parameters.GetAttributeObject("iListSourceOcc")

if ( true == Parameters.HasAttribute("iTargetOcc"))
	set iTargetOccurrence= Parameters.GetAttributeObject("iTargetOcc")

if ( true == Parameters.HasAttribute("iWorkbenchName"))	
	set iWorkbenchName= Parameters.GetAttributeString("iWorkbenchName")
	
set oIsAuthorized = true	

set TargetReference = ThisObject
if (NULL <> TargetReference)
{
	set NbSource = iLstSourceOccurrences.Size()
	set Index = 1
	for Index while Index <= NbSource
	{
		set CurProdResSourceOcc = iLstSourceOccurrences->GetItem(Index)
		if (NULL <> CurProdResSourceOcc)
		{
			set CurrentSourceRef = CurProdResSourceOcc.Reference
		}
		else
		{
			set CurProcessSourceOcc = iLstSourceOccurrences->GetItem(Index)
			if (NULL <> CurProcessSourceOcc)
			{
				set CurrentSourceRef = CurProcessSourceOcc.Reference
			}
			else
			{
				set CurSysOpeSourceOcc = iLstSourceOccurrences->GetItem(Index)
				if (NULL <> CurSysOpeSourceOcc)
				{
					set CurrentSourceRef = CurSysOpeSourceOcc.Reference
				}
			}
		}
		if (NULL <> CurrentSourceRef)
		{
			if ((CurrentSourceRef.IsSupporting("Provide") == true) and (TargetReference.IsSupporting("DELLmiGeneralOperationReference")) and (iWorkbenchName == "DELPPRLivePPREditorWkb"))
			{
				oIsAuthorized = false
				oMessage="Drag and Drop Provide on General Operation not allowed in Planning Structure"
				break
			}
			else if ((CurrentSourceRef.IsSupporting("DELLmiGeneralOperationReference") == true) and (TargetReference.IsSupporting("Robot")) and (iWorkbenchName == ""))
			{
				oIsAuthorized = false
				oMessage="Drag and Drop General Ope on Robot not allowed in  Planning Structure"
				break
			}
		}
	}
}

if (NULL <> oIsAuthorized)
	Parameters.SetAttributeBoolean("oIsAuthorized", oIsAuthorized)
if (NULL <> oMessage)
	Parameters.SetAttributeString("oMessage", oMessage)