| View previous topic :: View next topic |
| Author |
Message |
fcai
Joined: 24 Jun 2009 Posts: 44
|
Posted: Thu Jul 02, 2009 12:40 am Post subject: Can we do conditional transition of states? |
|
|
one-to-many states case
A->B
A->C
A->D
Transition of state is based on execute script/trigger on a custom field value.
It is kind of dynamically transition from one state to one of other states based on certain custom field value.
Currently ,It looks like I can only relate transition to a given message which does not allow me to do dynamic transition of state.
Can we do that?
Thanks |
|
| Back to top |
|
 |
admin Site Admin

Joined: 01 Jan 1970 Posts: 6122 Location: Smolensk, Russia
|
Posted: Thu Jul 02, 2009 4:48 pm Post subject: Re: Can we do conditional transition of states? |
|
|
Which TS version do you use ? _________________ Maxim Kramarenko (mailto: maximkr@trackstudio.com)
TrackStudio - Hierarchical Bug & Issue Tracking Software
http://www.trackstudio.com |
|
| Back to top |
|
 |
fcai
Joined: 24 Jun 2009 Posts: 44
|
Posted: Thu Jul 02, 2009 7:34 pm Post subject: 3.5.51 |
|
|
3.5.51
I did some investigation and it seems like transition of state has be bound to the message creation which I could not do state transition on fly. |
|
| Back to top |
|
 |
Tr1aL TrackStudio Support
Joined: 15 Apr 2008 Posts: 60 Location: Smolensk
|
Posted: Mon Jul 06, 2009 4:57 pm Post subject: |
|
|
For example, before add message trigger
| Code: |
String udfValue = message.getUdfValue("Name of Custom Field");
if (udfValue.equals("value 1"))
message.setMstatus("Name of state B");
else if (udfValue.equals("value 2"))
message.setMstatus("Name of state C");
else if (udfValue.equals("value 3"))
message.setMstatus("Name of state D");
return message;
|
|
|
| Back to top |
|
 |
fcai
Joined: 24 Jun 2009 Posts: 44
|
Posted: Mon Jul 06, 2009 7:32 pm Post subject: But how to define the transition in this case? |
|
|
Thanks, Tr1aL.
Should I do multiple Starting State like this and how?
A->B
A->C
A->D |
|
| Back to top |
|
 |
Tr1aL TrackStudio Support
Joined: 15 Apr 2008 Posts: 60 Location: Smolensk
|
Posted: Mon Jul 06, 2009 8:49 pm Post subject: |
|
|
| Yes |
|
| Back to top |
|
 |
fcai
Joined: 24 Jun 2009 Posts: 44
|
Posted: Mon Jul 06, 2009 9:06 pm Post subject: Still not understand |
|
|
In order to do A->B,A->C, A->D, It looks like I need create at least 3 types of messages associated with it.
Is anyway I can do this dynamic transition in one message creation? |
|
| Back to top |
|
 |
fcai
Joined: 24 Jun 2009 Posts: 44
|
Posted: Tue Jul 07, 2009 12:26 am Post subject: Here is what I tried based on your suggestion: |
|
|
1. create before add message trigger (or after add message trigger)
CT(conditional transition) with the following script code:
String udfValue = message.getUdfValue("Cost");
if (udfValue.equals("100"))
message.setMstatus("B");
else if (udfValue.equals("200"))
message.setMstatus("C");
else if (udfValue.equals("300"))
message.setMstatus("D");
return message;
2. create workflow "Conditional Transition Flow" with state 'A', 'B', 'C', 'D'.
3. create a message type 'note' with transition from 'A'->' A'
and using predefined trigger 'CT'. (can not do 'A' to 'B', 'A' to 'C' or 'A' to 'D' in same message type note)
4 create custom field 'Cost' in "Conditional Transition Flow' with type Integer(Also tried String type too and not working neither).
Set value=200
5. Then I create Category 'Purchase' using 'Conditional Transition flow'
6. create a project from category above.
7. create message 'note' in project and project state still in 'A', it does not jump to 'B'.
Have I done something wrong here or missed something?
Thanks,
Fred |
|
| Back to top |
|
 |
Tr1aL TrackStudio Support
Joined: 15 Apr 2008 Posts: 60 Location: Smolensk
|
Posted: Wed Jul 08, 2009 12:27 am Post subject: |
|
|
Sorry, I don't understand you in last message.
Trackstudio save history of state transactions, on it you should create transactions for all state changes.
Create:
Note B (A->B)
Note C (A->C)
Note D (A->D)
After that you can use them in triggers. |
|
| Back to top |
|
 |
fcai
Joined: 24 Jun 2009 Posts: 44
|
Posted: Wed Jul 08, 2009 1:11 am Post subject: does this mean I can not do dynamic state transition? |
|
|
| Tr1aL wrote: | Sorry, I don't understand you in last message.
Trackstudio save history of state transactions, on it you should create transactions for all state changes.
Create:
Note B (A->B)
Note C (A->C)
Note D (A->D)
After that you can use them in triggers. |
Thanks a lot, Tr1aL.
So basically I could not do state transition on fly based on value of a custom field in one state transaction (create a message for project), correct?
I think it will be very nice if you can provide this feature in your future release.
Fred |
|
| Back to top |
|
 |
|