It's all about the answers!

Ask a question

Setting state of work item in post-condition


Baris Erdemir (1812819) | asked Mar 02 '11, 12:29 p.m.
Hi,
I would like to take a workflow action in post-condition of work item save operation. Is that possible? If yes can you please give information and an example from the appropriate API?
Thanks,

4 answers



permanent link
Philippe Krief (561255) | answered Mar 02 '11, 5:35 p.m.
JAZZ DEVELOPER
Baris,
Are you talking about a pre-condition or a follow up action?
I'm not aware of any "post condition" or did I miss something?

# Pre-Condition
===========
I assume that you already went thru the following page: https://jazz.net/wiki/bin/view/Main/RTCSDK20_ProcessPreConditionExample.

You can find a good example of a "pre condition" in you check, for example, the class com.ibm.team.workitem.service.internal.save.AllChildrenClosedPrecondition stored in the plugin com.ibm.team.workitem.service.
The class has to be an implementation of IOperationAdvisor, the plugin must extend the extension point "com.ibm.team.process.service.operationAdvisors" and the "com.ibm.team.repository.common.components".

# Follow-up
========
For the follow up action, you can check out our workshop http://jazz.net/library/article/477. It adds a follow up action on the save work item event.

I hope it will help

permanent link
Baris Erdemir (1812819) | answered Mar 03 '11, 9:09 a.m.
Hi Philippe,
Sorry for misleading you in the question. I went through that articles and I already have running pre-conditions and follow up actions.

I am rephrasing my question:

I have 4 States (S1, S2, S3, S4) and 3 actions (a1, a2, a3)
Here is the flow definition:
a1 : S1 -> S2
a2 : S2 -> S3
a3 : S2 -> S4

When I take action a1, Before the state became S2, a pre-condition will run. then, WI will be in state S2. At same state, a follow-up action will run and check a flag in work item and depending on the flag, follow-up action will take action a2 and set state to S3 or not.

Is that possible?
Can I set state of a workitem in a follow-up action? If yes, can you provide appropriate API for this?
Thank you,


permanent link
Daniel Toczala (88211514) | answered Mar 03 '11, 2:39 p.m.
FORUM MODERATOR / JAZZ DEVELOPER
What you are talking about is a scripted series of actions and state transitions. You could do this with some sort of script, but I don't think that this is what you want.

I think you would need to create a process extension to provide a participant for the Event Handling (Work Item State Changed Event) that would create an event follow up action. I see the event in the version of RTC that i am using right now, but there are no configured follow up actions. This tells me that you would be able to create an extension point for this.

permanent link
Baris Erdemir (1812819) | answered Mar 04 '11, 3:19 a.m.
What you are talking about is a scripted series of actions and state transitions. You could do this with some sort of script, but I don't think that this is what you want.

I think you would need to create a process extension to provide a participant for the Event Handling (Work Item State Changed Event) that would create an event follow up action. I see the event in the version of RTC that i am using right now, but there are no configured follow up actions. This tells me that you would be able to create an extension point for this.


Hi Daniel,
Thanks for the answer,

I have a follow-up action that is attached to work item save operation. (I wrote the action and bound it to work item save operation). I will extend that follow up action. what I would like to do is:
If the work item is the item I want and if the state is s2,
check the flag, if set,
set state of the work item to s3

I'm done till the last statement. I just need the appropriate API to the last line that sets state of the work item.

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.