locked
Activity Name validation bug? RRS feed

  • Question

  •  

    Hi,

     

    I've run into what seems to be a bug with activity name validation when using custom library activities. I create a custom composite activity (called Activity1) which contains a delay activity called delayActivity1. I compile this into a library and then use it in a workkflow. I can add as many Activity1's as I want without trouble, even though each contains a 'delayActivity1'. Each Activity1 gets a unique name within the workflow, but the child activities do not change name. This is what I expect.

     

    However, when I add a new sequence (or any composite activity) to the workflow and add a new delay activity to the sequence, it also gets the name 'delayActivity1'. There is no designer error so I assume it is a valid name. However, when I compile the workflow, I get the error:

     

    Error 2 Activity 'delayActivity1' validation failed: There is already an activity named 'delayActivity1'. Activity names must be unique.

     

    First off, this seems inconsistent. If child activites within custom activities aren't validated against children of other custom activities, why are they validated against children of the workflow? Secondly, why does the designer allow this but the compiler does not?

     

    But that's not all...here's the really weird part. If I add the delay activity on it's own the workflow (outside of a composite activity), it compiles fine, even with the duplicate name! Also, if the newly added sequence is in the workflow BEFORE the custom activities they will also compile without error! It is only if they are after the custom activity in the workflow sequence that there is an issue.

     

    This is a headache for us, as we use a re-hosted workflow designer and make heavy use of library activities. Our users are going to be frustrated if they run into this constantly, especially since compile time errors are much less visible in our environment that in VS. It seems that the compiler should either ignore children of library activities when validating names, or the design time name generator\validator should take care of this.

     

    Is there any short term solution to this problem before the bug is resolved?

     

    Ryan

     

     


     

    Tuesday, October 16, 2007 4:58 PM

Answers

  • Send me a sample project that reproduces the error, my email address can be found in my profile.

     

    [Edit]

     

    Don't bother sending the project, I have been able to repro the issue.  It is a bug and we will look into the issue.

     

    Thursday, October 18, 2007 8:50 PM

All replies

  • Ryan,

     

    I tried your scenarion with both WF V1.0 and the Orcas bits. Could not reproduce this error. What version/configuration are you using please?

     

    Without being able to reproduce it, my only other suggestion would be to re-name your Delay inside the custom activity.

     

    Thanks,

    -Constantin

     

    Tuesday, October 16, 2007 6:00 PM
  • As far as I know I have WF V1.0....The assembly version on my WinWF assemblies is 3.0.0.0, the file version is 3.0.4203.2.

    Tuesday, October 16, 2007 6:09 PM
  • Also, it seems that this behaviour is only seen when working with a code seperation (xoml) workflow. Perhaps that is why you could not reproduce it.

    Tuesday, October 16, 2007 8:06 PM
  • I also cannot reproduce it with code seperation (xoml) workflow.

    What version of the Visual Studio are you using? VS2005 or V2008 Beta2 ?

     

    Thursday, October 18, 2007 7:43 AM
    Moderator
  • Ryan,

     

    Without being able to reproduce this, my only other suggestion is to try to rename your DelayActivity inside the custom activity. This should circumvent the problem you encounter in my opinion.

     

    Thanks,

    -Constantin

     

    Thursday, October 18, 2007 4:56 PM
  • I am using VS2005. I'm not sure why this isn't reproducible for you. Can I post a screenshot somehow to illustrate exactly what I'm doing?

     

    Renaming the activity isn't really a solution for us, as our customers will be creating their own activities and naming them whatever they like. The delay activity was just an example to illustrate the problem.

     

    Ryan

    Thursday, October 18, 2007 5:16 PM
  • Send me a sample project that reproduces the error, my email address can be found in my profile.

     

    [Edit]

     

    Don't bother sending the project, I have been able to repro the issue.  It is a bug and we will look into the issue.

     

    Thursday, October 18, 2007 8:50 PM