Workflow variables manipulation during its execution

Locked Workflow variables manipulation during its execution

  • lunes, 26 de septiembre de 2011 3:43
     
     

    Hi,

    We're developing a multilevel Visual Studio 2010 approval workflow to be deployed in SharePoint 2010 Site. Here, we're fetching data from sharepoint lists and stores it inside the Workflow Variables.

    One of the attributes stored within the workflow variables is list of approvers stored in the format of string seperated by commas. This workflow also sends out the notifications to these approvers on successful approval / rejection.

    If there is a manual intervention changing an approver for a particular task (through custom task edit form) then we need to make sure the same change should be applied to the list of approvers which is there in Workflow Variable.

    Thus, during execution, within the context of this workflow, is it possible to modify the data stored within workflow variables and then resume the workflow execution from that point ?

    Any suggestions / info would be much appreciated on this.

    Thanks,

    Vishwajit

Todas las respuestas

  • viernes, 30 de septiembre de 2011 7:20
    Moderador
     
     
    Hi, Vishwajit

    Have you consider using HandleExternalEventActivity. by this activity, you can pass your own value into the workflow from the host(outside world).
    Also see this:
    http://xhinker.com/2009/10/29/WFHandleExternalEventActivity.aspx

    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
  • lunes, 10 de octubre de 2011 4:58
     
     

    Hi Andrew,

    Thank you very much for your suggestion ! I've gone through the same, still I'm wondering whether this activity will only be able to send custom data back to workflow or whether it can modify the existing data stored inside workflow variables ?

    Can you please shed some light on this ?

    Thanks

    Vishwajit

  • jueves, 20 de octubre de 2011 4:54
     
     

    Hi Vishwajit

    If you want to store data inside the Workflow activity and pass it to the other activities then you can use Dependency Property. I am giving one example as follows.  

    <MyActivity x:Name="MyActivity" InputParameter="{ActivityBind YourVaiableName,Path=Path for the Parameters}/>

     

    publicstatic DependencyProperty InputParameterProperty = DependencyProperty.Register("InputParameter", typeof(string), typeof(NameOftheclasswhereyouhavecreatedthedependencyproperty));

     

    public string InputParameter

    {

      get

      {

        return (string) GetValue(InputParameterProperty);

      }

      set

      {

        SetValue(InputParameterProperty, value);

    }

    So here you can store any value to your InputParameter and use/manipulate that value in some other activities.

    Hope the above helps.

    Thanks

    Saswati


    Saswati Sanyal Blog : http://saswatisanyal.blogspot.com/
  • lunes, 24 de octubre de 2011 6:45
     
     

    Hi Saswati,

    In my scenario, I'm storing the workflow initiation data in workflow variables and then at some instant when workflow is in progress, I wanted to change the data *dynamically* stored within these workflow variables !

    Not sure, whether I can use built-in/custom workflow activity for this, but then somehow I need to modify these workflow variables !

    Thanks,

    Vishwajit

  • miércoles, 26 de octubre de 2011 3:40
     
     

    Hi Vishwajit,

    If you are using Activity then at any point of time you can use/modify the parameter that you are using inside that activity from the other activity. However if you can share some sample code then I can try to reproduce your issue.

    Thanks

    Saswati

     

     


    Saswati Sanyal Blog : http://saswatisanyal.blogspot.com/