locked
Save transition data to state variables RRS feed

  • Question

  • Hi,

    It might be a stupid question, but I cannot figure it out - let's say we have a part of a state-machine like this:

    [POS-view] ------ init-order -------> [Transaction]

    Where [POS-view] and [Transaction] are states and init-order is a transition.

    [Transaction] has a variable with the name order.

    init-order has custom trigger, where I have an OutArgument defined, so that I from the program hosting the workflow can say resumeBookmark("init-order", currentOrder);

    So now, I would like to place the argument, from the trigger in init-order in the variable order in [Transaction]. This cannot be done, clearly, because the transaction happens before the state. But I would like NOT to place the variable in the [POS-view] state. Am I doing anything not-intended or what can I do to solve this problem.

    Thank you.

    Morten


    Remember to mark as answer if my post helped you
    Tuesday, November 29, 2011 8:38 PM

Answers

  • Hi,

    You'll need to use a Variable that both the trigger and [Transaction] can find the value in the path to the root activity. In your case, you can add a variable to the statemachine workflow instead of specific state.

    Thanks.


    Leo Tang [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Thursday, December 1, 2011 9:57 AM

All replies

  • Hi,

    You'll need to use a Variable that both the trigger and [Transaction] can find the value in the path to the root activity. In your case, you can add a variable to the statemachine workflow instead of specific state.

    Thanks.


    Leo Tang [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Thursday, December 1, 2011 9:57 AM
  • Hello Leo,

    Yes, it needs to be in a higher level, which was what I tried to write with placing the variable in [POS-View], which would not work, they way I wrote it.

    Do you know if there is a better way, or a better approach?

    /Best


    Remember to mark as answer if my post helped you
    Thursday, December 1, 2011 2:59 PM