Can Support dynamic set State in code?

Apr 29, 2010 at 6:03 AM

Can Support dynamic set State in code?

such as a flow  StateA->StateB->StateC->stateD.

when the flow run at StateC,I want to go to StateA in code by the code(WorkflowApplication.SetState(StateA))?

May 3, 2010 at 2:26 AM

We do not support this feature at the moment.  Could you explain why you need to do this in code?  Ideally all the state change logic is done using transitions so it's all declarative and transparent.

May 3, 2010 at 10:46 AM

if the workflow rule is very much,the all declarative and transparent will be make the transition lines very much and in a mess。

May 3, 2010 at 6:31 PM

Do you mean too many transitions in designer look messy such that you want to represent some transitions in codes? If that's correct, I think we may need improve designer futher, instead to support additional API for this purpose. SetState could be mistakenly used if it's exposed. I wonder whether there are any other scenarios you want to use SetState?

May 4, 2010 at 12:49 AM
in my scenarios ,for a example,when the flow run at StateC,the approver can reject the flow,he can choose reject to StateA,StateB.but we will do not know what he choose.if we have lots of States,in order to this purpose,we will make lots of transition lines. if the designer release to customer,the customer consider this feature is inborn,do not need draw the transition lines.
May 4, 2010 at 6:44 PM
Edited May 4, 2010 at 6:53 PM

So the main issue is there are too many transition lines on designer surface. We may provide some options, like make a transition line visible/invisible to achieve that.If SetState is used in this case, who should receive the message from manager. If it's a Receive activity within workflow, it's not easy for codes which uses WorkflowApplication.SetState() to know what value is received.

May 5, 2010 at 3:31 AM
Xianfeng wrote:

So the main issue is there are too many transition lines on designer surface. We may provide some options, like make a transition line visible/invisible to achieve that.If SetState is used in this case, who should receive the message from manager. If it's a Receive activity within workflow, it's not easy for codes which uses WorkflowApplication.SetState() to know what value is received.

 when the next version release?  and what feature will coming?

May 5, 2010 at 4:42 PM

The time of next verision and features are still on planning. It partially depends on the feedbacks of this release.

May 6, 2010 at 1:30 AM

Do you plan the feature that can dynamic add ,insert or delete the State in code?