Search
Resolved
as By Design Help for as By Design

0
Sign in to vote
0
Sign in to vote
Sign in
to vote
Type: Bug
ID: 489682
Opened: 9/14/2009 2:15:16 AM
Access Restriction: Public
0
Workaround(s)
0
User(s) can reproduce this bug
If you Create a Workflow and pass parameters, the workflow gets validated, before the parameters are assigned. This is wrong. You expect, that the Workflow is valid with the NEW (=passed) properties, not the OLD ones.
e.g:
The workflow has a custom Validator to validate that a property is not null (required).
If this property is assigned with passed parameters. The error (Validation failed) is raised
before the property is assigned.

To have a workaround: is there a way to validate a workflow after it is created ?
this would allow do disable worklow validation in the runtime and validate it after loading manually.
Details (expand)

Product Version

.NET Framework 3.5 SP1
Product Language
English

Operating System
Windows 7 (client)
Operating System Language
Other ( please specify in Repro Steps)

Architecture
x64

Priority
(1=blocking, 2=important, 3=nice to have)
2

Severity
(1=major functionality issue, 2=important functionality issue, 3=nice to have)
1

Steps to Reproduce
Create a Workflow with a property "TestString" that gets validated by a ActivityValidator. e.g. a property required validator that checks that "TestString" is not null or empty.
Leave the Property "TestSring" empty.
Load the Workflow with:

Dictionary<string, object> customProperties = new Dictionary<string, object>();
customProperties.Add("TestString", "blabla");

WorkflowInstance instance = Runtime.CreateWorkflow(reader, null, customProperties));
Actual Results
Runtime.CreaetWorkflow raises a WorkflowValidationException because the workflow is validated, before the passed properties are set.
Expected Results
The Workflow is validated after the passed properties are set.
Component Usage
(any information on your scenario that may help in investigating your issue)
 

How often does this happen?
Always Happens

Have you seen this problem in other versions?
I don't know if this issue existed previously

File Attachments
0 attachments
Sign in to post a comment.
Posted by Microsoft on 9/14/2009 at 7:51 PM
Thank you for your feedback, We are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com/)
Posted by Microsoft on 9/22/2009 at 4:09 PM
Thanks for submitting this bug!

This behavior that you are experimenting is by design. Validation occurs only for the workflow definition (the configured tree of activities) i.e. statically. If an author needs to validate a value at runtime that logic needs to be built into the workflow. This validation can be done early in the “Initialize” method or later when the variables are used in the “Execute” method (so you will need to override one of these methods).

Please let me know if this helps,

Leon Welicki
Program Manager, Connected Framework Team