// Drag of process variables onto a node param will create a process variable link
ProcessVariable processVariable = (ProcessVariable) data.getTransferData(ClientFlavors.PROCESS_VARIABLE);
getDrawing().getEditor().startUndo("Add Global Link");
DataLink dataLink = getDrawing().getProcess().createDataLink();
// Determine source and target parameter depending if we have an in- our outgoing global link
Param sourceParam;
Param targetParam;
SocketFigure socketFigure = (SocketFigure) getParent();
if (socketFigure.isEntrySocket())
{
sourceParam = processVariable;
targetParam = nodeParam;
}
else
{
sourceParam = nodeParam;
targetParam = processVariable;
}
// Link the global to the node parameter
dataLink.link(sourceParam, targetParam);
// Apply auto-conversions if necessary
String sourceMemberPath = AutoConnector.checkAutoConversion(sourceParam, null, targetParam, null);
dataLink.setSourceMemberPath(sourceMemberPath);
getDrawing().getProcess().addDataLink(dataLink);
((WorkspaceDrawingView) getDrawing().getEditor().view()).singleSelect(setProcessVariableConnection(processVariable, dataLink));