Script Component Plus Configuring Dynamic Flow Fuzzy Lookup

66 views
Skip to first unread message

RG

unread,
May 3, 2016, 12:06:01 PM5/3/16
to COZYROC
Hello,

I have been working on a solution using CozyRoc components to create a configurable fuzzy lookup process.  Beyond the DataFlow Plus with a Fuzzy Lookup control, I am also providing configurations for fuzzy component properties (ex. MaxOutputMatchesPerInput).  This has been completed through using a ScriptComponentPlus task using a PackageConnection to the current package.  Below is the code that is being used to configure the Fuzzy Lookup properties (this is geared towards the structure of my generic package, and based on advice from Ivan).  This seems to work fine in one environment, but in another environment I am receiving a message "Failed to retrieve active package".  

This script task is prior to the dynamic data flow using the Fuzzy Lookup.  In trying to Debug, my breakpoints do not seem to persist in the Scipt Component Plus editor.  Please advise if there is anything that can be looked at to either enable debugging, or even better, resolve this issue.


            try
            {
                ConnectionManager manager = Dts.Connections[this.PackageConnection];
                IPackageConnection connection = (IPackageConnection)manager.AcquireConnection(null);
                Package p = (Package)connection.GetPackage();

                foreach (Executable e in p.Executables)
                {
                    try
                    {
                        Microsoft.SqlServer.Dts.Runtime.ForEachLoop fe = (Microsoft.SqlServer.Dts.Runtime.ForEachLoop)e;

                        foreach (Executable ee in fe.Executables) 
                        {

                            try
                            {
                                TaskHost th = (TaskHost)ee;


                                MainPipe pipe = (MainPipe)th.InnerObject;

                                foreach (IDTSComponentMetaData100 o in pipe.ComponentMetaDataCollection)
                                {

                                    if (o.ComponentClassID == "{E4A5F949-EC93-45AB-8B36-B52936257EC2}")
                                    {

                                        OleDbDataAdapter oleDA = new OleDbDataAdapter();
                                        DataTable dt = new DataTable();

                                        oleDA.Fill(dt, Dts.Variables["ComponentProperties"].Value);

                                        foreach (DataRow dr in dt.Rows)
                                        {
                                            o.CustomPropertyCollection[dr["PropertyName"].ToString()].Value = dr["PropertyValue"].ToString();

                                        }


                                    }

                                }
                            }
                            catch{}                                        
                        }
                   }
                   catch{}

               }
               Dts.TaskResult = (int)ScriptResults.Success;
            }           
            catch (Exception ex)
            {
                Dts.Events.FireError(0, "Dynamic Fuzzy", ex.Message, "", -1);
                Dts.TaskResult = (int)ScriptResults.Failure;
            }



Best Regards,
Ryan Gillings

Ivan Peev

unread,
May 3, 2016, 6:51:46 PM5/3/16
to COZYROC
Hi Ryan,

If you are getting the error below you either don't have the SSIS+ library installed or the library is not installed properly. I would recommend you uninstall and then reinstall the SSIS+ library. Also check whether the machine you believe you are executing on is the actual machine where the package runs. You can print what is the execution machine name in the log. Use printing in the log to also do tracing what might be wrong with your script.
Reply all
Reply to author
Forward
0 new messages