locked
Can I modify the rule conditions of Policy activity(called from WF 4 through Interop activity) at runtime on executing workflow 4 instances RRS feed

  • Question

  • Hi,

    My requirements are such that I need to use Policy activity from Workflow 3.x into Workflow 4 using Interop activity.

    I have created a solution using .Net framework 4, in that I have added a workflow3.x activity project which contains a custom activity which contains a Policy activity. Then, i added a workflow console application project using Workflow 4, added an interop activity to the workflow and called the 3.x custom activity through Interop activity.

    My question is can I modify the rule conditions at runtime on executing workflow 4instances.

    Thanks

    Neha

    Wednesday, March 2, 2011 11:44 AM

Answers

  • Hi, Neha

    ->"added an interop activity to the workflow and called the 3.x custom activity through Interop activity."
    To make things clean and robust, we'd better separate WF3.5 and host it as a WCF service. then in WF4 workflow, use Send activity to call the WF3.5 workflow service.

    We can update WF3/3.5 workflow when it is in execution. while we should not update WF4 workflow instance while execution.
    http://xhinker.com/2009/10/11/WFDynamiclyAddActivitiesToWorkflowInRuntime.aspx

    Hope this helps.
    Regards
    MSDN Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    This posting is provided "AS IS" with no warranties, and confers no rights. My Blog: http://xhinker.com
    Microsoft Windows Workflow Foundation 4.0 Cookbook
    • Marked as answer by Andrew_Zhu Wednesday, March 23, 2011 8:17 AM
    Monday, March 7, 2011 5:02 AM

All replies

  • Hi, Neha

    ->"added an interop activity to the workflow and called the 3.x custom activity through Interop activity."
    To make things clean and robust, we'd better separate WF3.5 and host it as a WCF service. then in WF4 workflow, use Send activity to call the WF3.5 workflow service.

    We can update WF3/3.5 workflow when it is in execution. while we should not update WF4 workflow instance while execution.
    http://xhinker.com/2009/10/11/WFDynamiclyAddActivitiesToWorkflowInRuntime.aspx

    Hope this helps.
    Regards
    MSDN Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    This posting is provided "AS IS" with no warranties, and confers no rights. My Blog: http://xhinker.com
    Microsoft Windows Workflow Foundation 4.0 Cookbook
    • Marked as answer by Andrew_Zhu Wednesday, March 23, 2011 8:17 AM
    Monday, March 7, 2011 5:02 AM
  • Hi Andrew,

    I understood your answer. Is this the only way to alter the Policy activity while the WF 4 workflow instance is executing(as we cannot modify the WF 4 workflow instance).

    Or in other words is it possible to call and then update Policy activity directly from WF 4 workflow(without exposing WF 3.5  as a WCF service)

    Thanks

    Neha

    Tuesday, March 8, 2011 5:44 AM
  • Hi, Neha

    ->"I understood your answer. Is this the only way to alter the Policy activity while the WF 4 workflow instance is executing(as we cannot modify the WF 4 workflow instance)."

    Since we cannot alter WF4 workflow definition in execution.  that is the only easy way come to my mind.

    Regards
    MSDN Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    This posting is provided "AS IS" with no warranties, and confers no rights. My Blog: http://xhinker.com
    Microsoft Windows Workflow Foundation 4.0 Cookbook
    Wednesday, March 9, 2011 1:45 AM