locked
Want to Load and schedule a child activity from a database RRS feed

  • Question

  • I've been looking at other threads for this answer and it does not seem to exist. The DynamicActivity created by ActivityXamlServices cannot be scheduled as a child of another Activity (for instance a NativeActivity) unless it is instantiated in the constructor, which precludes using an input argument as a database key.

    My conclusion is that the only pattern for storing XAML in a database is when the XAML contains the entire Workflow. This is not very useful if you want to dynamically select your Workflow based on some parameter that may be an input argument to the Workflow.

    For my application, this greatly limits the usefulness of WF 4.0.

    Does anyone have a solution to this problem?


    ------------------------
    Mark Northup
    Tuesday, September 14, 2010 6:38 PM

All replies

  • Have you tried adding the dynamic activity as an implementation child in the CacheMetadata event?

     

    This article has a brief code sample that includes using the AddImplementationChild method:

     

    http://social.technet.microsoft.com/wiki/contents/articles/passing-arguments-to-activities-scheduled-by-nativeactivity-wf.aspx

    • Marked as answer by MNorthup Monday, September 20, 2010 6:36 PM
    • Unmarked as answer by MNorthup Monday, September 20, 2010 6:38 PM
    Tuesday, September 14, 2010 8:37 PM
  • That is great! It nicely takes care of passing arguments from the Parent to the Child Activity.

    But, it does not solve the problem that the Child Activity needs to be fully instantiated in the constructor. This eliminates the possibility of loading an Activity from a database (or file) based on an input argument to the Parent.

    Now that I know the limitations of WCF, I will proceed with an alternate design.

    Thanks for you response.


    Mark Northup
    Monday, September 20, 2010 6:42 PM