Sunday, February 19, 2012

Debugging a script component task?

How to debug a Script Component task?

For instance, I’ve got a Input0_ProcessInputRow procedure and I’d like to see what happen when compiler reach this line:

dFecha = Left(Row.Column19, 4) & "-" & Mid(Row.Column19, 5, 2) & "-" & Right(Row.Column19, 2)

I’ve put a toogle breakpoint there and then saved but when I run the package to ignore at all.

This topic has been already discussed in these newsgrups but I still have doubts.

Thanks a lot for any advice or clarification

Unfortunately you can't debug script components with breakpoints as you can in the script task.

Your best option is to fire events from within the script component that output teh values that you are interested in.

Not great but for now its what we're stuck with I'm afraid.

-Jamie

|||

Thanks Jamie.

Anyway, I tried to allocate a MessageBox.Show... method but it did not work....

According to DarrenSqlis you can do that with Script Task no with Script Component task

|||

Correct. Message box only works in script task as well.

-Jamie

|||

So that, as you said we are totally stuck. I'll use variables in order to see anything

seeya

|||

Try firing OnInformation events containing the information that you are interested in.

-Jamie

|||

are you talking about Event Handlers tab and then choose Data Flow task and to capture oninformation event and do some stuff there?

thanx

|||

You can fire events from within the script component that will then be caught by the eventhandlers. Here's some code that would output the value of a variable:

ComponentMetaData.FireInformation(1, "MyScriptComponent", "VariableName=" + CStr(Me.Variables.VariableName), "", 0, True)

You can change it to output whatever you like.

Once the eventhandler catches the fired event then you can do whatever you like with the value.

-Jamie

|||

hi again,

I suppose that 'MyScripComponent' is equal to the name of my script, in my case "ScriptMain", isn't it? Or maybe the name of my Data Flow component?

Where you put VariableName are you referring a variable defined in my package.

thanks a lot

|||

You can put whatever you like for most of the parameters. Where it says "MyScriptComponent" you can even leave that blank if you want. The important bit is what you are outputting in the "Description" parameter.

And yes, VariableName is a variable defined in your package and referenced in ReadWritevariables. It doesn't have to be a variable though - that was just an example. You can output whatever you like (e.g. a value in your incoming row or a calculated value)

Just go into your script component and type:

"Componentmetadata.FireInformation("

and let intellisense help you from there.

-Jamie

|||Thanks for everything!|||msgbox.Show(string) does not work... But msgbox(string) should work...|||

hi TGnat,

you're right, that works. Thanks a lot I hadn't though it

No comments:

Post a Comment