/// <summary>
        /// Creates the cross reference source field.
        /// </summary>
        /// <param name="field">The field.</param>
        /// <param name="owner">The owner.</param>
        /// <returns>SourceField.</returns>
        private static SourceField CreateCrossReferenceSourceField(FieldEdit field, ExpressionObjectBase owner)
        {
            var dataType = field.IsSingleCrossReference()
                               ? NodeDataType.CrossReference
                               : NodeDataType.List;

            var requiredStep = (CrossRefRequiredStepEdit)field.StepList.FirstOrDefault(s => s is CrossRefRequiredStepEdit);

            IExpressionFieldsRetriever subfieldsRetriever = null;

            if (requiredStep != null && requiredStep.CrossRefProcessId.HasValue)
            {
                subfieldsRetriever = new CrossReferenceSubfieldsRetriever(requiredStep.CrossRefProcessId.Value, CanBeSourceField, CreateSourceField);
            }

            var sf = new SourceField(owner)
                {
                    DataType = dataType,
                    Name = field.Name,
                    ConnectorOut = { DataType = dataType, Name = field.Name },
                    SystemName = field.SystemName,
                    SetName = SourceFieldSetNames.DataTriggerSourceItem,
                    SubfieldsRetriever = subfieldsRetriever
                };

            return sf;
        }
        /// <summary>
        /// Creates the cross reference destination field.
        /// </summary>
        /// <param name="field">The field.</param>
        /// <param name="owner">The owner.</param>
        /// <returns>DestinationField.</returns>
        private static DestinationField CreateCrossReferenceDestinationField(FieldEdit field, ExpressionObjectBase owner)
        {
            var isSingleRef = field.IsSingleCrossReference();

            var df = new DestinationField(owner)
            {
                DataType = NodeDataType.CrossReference,
                Name = field.Name,
                ConnectorIn = { DataType = NodeDataType.CrossReference, Name = field.Name },
                SystemName = field.SystemName,
                SetName = SourceFieldSetNames.Item,
                IsKeyVisible = true,
                IsKeyEnabled = isSingleRef,
                SubfieldsRetriever = new CrossReferenceSubfieldsRetriever(field)
            };

            return df;
        }
 /// <summary>
 /// Gets a value indicating whether the specified field can be a source field.
 /// </summary>
 /// <param name="field">The field to check.</param>
 /// <returns>Returns true if <paramref name="field" /> can be a source field.</returns>
 private static bool CanBeSourceField(FieldEdit field)
 {
     return field.IsSingleCrossReference() || field.IsMultiCrossReference();
 }