Wednesday, March 7, 2012

Expression editor on Custom Properties on Custom Data Flow Component

Hi,

I've created a Custom Data Flow Component and added some Custom Properties.

I want the user to set the contents using an expression. I did some research and come up with the folowing:

Code Snippet

IDTSCustomProperty90 SourceTableProperty = ComponentMetaData.CustomPropertyCollection.New();
SourceTableProperty.ExpressionType = DTSCustomPropertyExpressionType.CPET_NOTIFY;
SourceTableProperty.Name = "SourceTable";

But it doesn't work, if I enter @.[System:Stick out tongueackageName] in the field. It comes out "@.[System:Stick out tongueackageName]" instead of the actual package name.

I'm also unable to find how I can tell the designer to show the Expression editor. I would like to see the elipses (...) next to my field.

Any help would be greatly appreciated!

Thank you

The expression for a component's property is held at the task level. If a property is marked as CPET_NOTIFY, it notifies the task (the data flow which parent's the component), which tells it to generate a new property on which can be set an expression. So to see the expression in the designer look at the properties grid for the data flow task, not the component.

|||Hello Darren,

Thank you for the quick response. But the expression editor doesn't show in the propertiesgrid either.

Could I be missing anything?|||

Are you looking at the properties grid of the DATA FLOW component or at your custom data flow component? Also, did you set the flag darren mentioned above so that the data flow component will know to include this property in it's properties expression list?

|||Ah, yes, I see it now. But it is not what I'm looking for.

Is there now way to set the expresison builder on the component itself? When the expression builder is used on the parent task, I cannot access the incomming rows.

Thank you kindly|||

Why do you think your component will have features over and above that available to Microsoft themselves?

Property expressions are ONLY available at the task level, because they are provided in the task framework.

You have created a property expression, so your mention of incoming rows does not make sense. Property expressions are just that, for the property, but not the value itself, the result will override the value. Just look how they work in the rest of SSIS.

A property that holds a text string that could be parsed as an expression is something different and maybe what you want? Perhaps the Derived Column transform may be easier?

No comments:

Post a Comment