Beispiel #1
0
 /// <summary>
 /// Initialises the import.
 /// </summary>
 /// <param name="transformId">The transform id.</param>
 /// <param name="iterator">The transaction iterator object.</param>
 /// <param name="updateOperation">The update operation for the import.</param>
 /// <param name="errorAction">The error action.</param>
 /// <param name="wrapper">The wrapper object.</param>
 public void Initialise(string transformId, TransactionIterator iterator, eERPUpdateOperation updateOperation, eTransformErrorAction errorAction, ImportHelper wrapper, SystemConnectorDTO system, ITransformAuditController auditController)
 {
     _transformId     = transformId;
     _iterator        = iterator;
     _updateOp        = updateOperation;
     _errAction       = errorAction;
     _wrapper         = wrapper;
     _system          = system;
     _auditController = auditController;
 }
Beispiel #2
0
        /// <summary>
        /// Is called before processing is started; do any initialisation here.
        /// </summary>
        /// <param name="transformDef">The connector transform definition.</param>
        /// <param name="iterator">The transaction iterator.</param>
        /// <param name="testMode">Indicates if transform is being run in the designer/Preview mode.</param>
        /// <param name="errAction">The action to take if there's an error.</param>
        /// <param name="updateOperation">Whether to insert and/or update and/or delete.</param>
        /// <param name="system">The System object containing the settings.</param>
        /// <param name="auditController">The audit controller object.</param>
        public void Initialise(TransformDefinition transformDef, TransactionIterator iterator, bool testMode, eTransformErrorAction errAction, eERPUpdateOperation updateOperation, SystemConnectorDTO system, ITransformAuditController auditController)
        {
            _transformDef    = transformDef;
            _iterator        = iterator;
            _testMode        = testMode;
            _errAction       = errAction;
            _updateOperation = updateOperation;
            _system          = system;
            _auditController = auditController;

            Logon(system);
        }
        /// <summary>
        /// Initialises the import.
        /// </summary>
        /// <param name="transformId">The transform id.</param>
        /// <param name="iterator">The transaction iterator object.</param>
        /// <param name="updateOperation">The update operation for the import.</param>
        /// <param name="errorAction">The error action.</param>
        /// <param name="helper">The wrapper object.</param>
        public void Initialise(string transformId, TransactionIterator iterator, eERPUpdateOperation updateOperation, eTransformErrorAction errorAction, ImportHelper helper, SystemConnectorDTO systemConnector, ITransformAuditController auditController)
        {
            _transformId     = transformId;
            _iterator        = iterator;
            _updateOp        = updateOperation;
            _errAction       = errorAction;
            _wrapper         = helper;
            _systemConnector = systemConnector;
            _auditController = auditController;

            _client      = new Client(systemConnector);
            _validStatus = null;            // _client.GetValidOrderStatuses();
        }
        /// <summary>
        /// Creates a TransformDefinition object for a Pull Style connector.
        /// </summary>
        /// <param name="systemConnectorId">The id for the System Connector used to retrieve the connection properties.</param>
        /// <param name="importDataType">The type of data being retrieved.</param>
        /// <returns>The constructed TransformDefinition object.</returns>
        protected TransformDefinition CreatePullStyleTransformDef(string systemConnectorId, string importDataType, eTransformErrorAction errorAction = eTransformErrorAction.eTransformErrorActionAbort)
        {
            TransformDefinition result = _jobDef.CreateTransform();

            ITransformSetup tfmSetup = new CustomReaderSetup();

            tfmSetup.InitialiseTransform(result);

            // Set the options for the Reader definition.
            result.Options.SetProperty(GlobalResources.SYS_CONNECT_TRAN_TYPE_OPT, importDataType, false);
            result.Options.SetProperty(GlobalResources.SYS_CONNECT_SYSID_OPT, systemConnectorId, false);
            result.Options.SetProperty(GlobalResources.CUS_CONNECT_ASSEMBLY_NAME_OPT, TestConstants.ASSEMBLY_NAME, false);

            // Set any custom options. Move this to your actual test code if the options are specific to a test.
            result.Options.SetProperty("Option1", "Option Value 1", false);
            result.Options.SetProperty("Option2", "Option Value 2", false);

            result.AuditDefinition.ErrorAction = errorAction;

            return(result);
        }