sider

hi everyone,
I have the following problem: in the Workflow Designer (from Hosting the Workflow Designer - MS HOLab) i have a workflow with an (start-)activity (customActivity) which use a string "ID" and work with it (read from DB, output in MessageBox, ...). I also use ISite, so if I insert an ifElseActivity after my customActivity Im able to choose RuleCondition and also Im able to see the RuleCondition-Editor (after choosing "New" Condition). But if I started to write "this.ID ==..." my string "ID" is not known... Sow how can I bind my "ID" to an ifElse-Activity

Thanks in advance,
best regards
sider


Re: Windows Workflow Foundation ifElseActivity in Workflow Designer-Tool

Kavita Kamani - MSFT

ID should be a property or field on your workflow. this refers to the workflow type. Go to the file where you have the workflow type defined and add the property/field there....

Does that make sense






Re: Windows Workflow Foundation ifElseActivity in Workflow Designer-Tool

sider

Hi, thanks for your quick answer.

Actually I think you get me wrong. In the WorkflowDesigner.exe (Re-hosting the workflow-designer) I create my own workflow with the one customActivity, Im creating in VStudio and have it in my own ActivityLibrary.
In this Activity I have the field ID and I give it the string "12345" (for example). Then I will have an ifElseActivity after this customActivity, but in the (declerative-)Rule Set Editor my ID (this.ID == "...") is not known and I cant bind this ID to the ifElse in their Properties.




Re: Windows Workflow Foundation ifElseActivity in Workflow Designer-Tool

Kavita Kamani - MSFT

Ah, sorry for misunderstanding. Please take a look at this post - http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=1334060&SiteID=1, its the same issue you're having. You can only access ID if its on the root workflow type (the "this"), if not you have to walk the activity tree.




Re: Windows Workflow Foundation ifElseActivity in Workflow Designer-Tool

sider

hi guys,

I`m a little bit further on my problem (Remember: add an ifElseActivity after a customActivity "customActivity1" in workflow designer-tool (HostingWorkflowDesigner from MSHOL10)): Instead writing: this.ID == "1234", Im adding the following to the RuleCondition Editor:

((ActivityLibrary.customActivity1)this.GetActivityByName("customActivity1")).ID == "1234"

So, now my property "ID" is known and I gave the (DeclerativeRule-)Condition the Name "ConditionIf". But when compiling the customWorkflow I get the following error message:

"error WF1342: Error when checking the activity 'ifElseBranchActivity1': Condition "ConditionIf" was not found."

Does anybody know why Im getting this, and what I have to do

Thanks in advance,
best regards sider




Re: Windows Workflow Foundation ifElseActivity in Workflow Designer-Tool

Kavita Kamani - MSFT

By any chance, did you add another class in the Workflow1.cs file before the Workflow1 class




Re: Windows Workflow Foundation ifElseActivity in Workflow Designer-Tool

sider

hi,
I dont have such a Workflow.cs file.All workflows I have are .xoml files (greated in re-hosted wfdesigner).
This error Im getting in the re-hosted tool..




Re: Windows Workflow Foundation ifElseActivity in Workflow Designer-Tool

Kavita Kamani - MSFT

You can make ID a dependency property.

You can right click and add a dependency property by doing insert snippet...

Check out the CustomActivityBind sample in the technology samples in the SDK - under here: Technologies \ Activities \ ActivityBinding \ CustomActivityBinding