lars corneliussen

Hello everybody,

Hope to find some help here. Just didn't know who to ask, so let me give it a try.

I simply want to access a Activity-Property in a Declarative Rule, but when using this.activityName I get the Template - and there the properties are empty. It's a custom activity derived from HandleExternalEventActivity wich sets it custom property ChangeParameters on OnInvoke()...

In a ifelse later I want to use this properties values for evaluation.

My condition:

this.Order.DeliveryAddress.Country.XLink == this.handleEvent.

ChangeParameters .CountryXLink

But handleEvent. ChangeParameters is null! It has to be, because this.handleEvent.IsDynamicActivity also is false.

If I use codecondition I can access the right activity instance via the sender, but this is not available from within the declarative conditions.

Your nearly crying,

Lars (Germany, now in Mexico)

Re: Windows Workflow Foundation Accessing Activity-Properties in Declarative Rule Expression

lars corneliussen

Hi again.... Just five minutes after writing to a forum i found the solutions. And seriously after searching for it at least two days. My SCRUM-Sprint is totaly wrecked by Workflow problems :-)

But to let you know, in a State-Machine you have to first get the "Root" by calling this.GetDynamicActivity("State or EventDriven Name") and then you'll get the right dynamic activity by GetActivityByName

So the Condition looks like that:

((CastToYourType)this.GetDynamicActivity("State or EventDriven Name").GetActivityByName('your handleexternalevent activity name")).YourProperty == "should be this value"

Sorry, dear Microsoft Team, but without a Intellisense leading totally wrong I may have found the solution earlier. I heard its gonna to be fixed in a version soon....