It's all about the answers!

Ask a question

Set work item resolution


Jeff Care (1.0k3833) | asked May 03 '11, 12:06 p.m.
I'm trying to modify the state and resolution of a work item using the 3.0 SDK.

Here's the relevant code:

    final IWorkItemWorkingCopyManager wiwcManager = wiClient.getWorkItemWorkingCopyManager ();


try {

wiwcManager.connect (workitem, IWorkItem.SMALL_PROFILE, getMonitor ());
}
catch (final TeamRepositoryException exp) {

throw StatusHelper.wrap ("failed to connect to work item working copy",
exp,
new IndentingPrintStream (stderr ()));
}

final WorkItemWorkingCopy wiwc = wiwcManager.getWorkingCopy (workitem);
wiwc.setWorkflowAction (action.getStringIdentifier ());

if (resolution != null)
wiwc.getWorkItem ().setResolution2 (resolution);

final IDetailedStatus status = wiwc.save (getMonitor ());
wiwcManager.disconnect (workitem);

if (!status.isOK ())
throw new FileSystemStatusException (status);


Modifying the state by setting an action works okay but I'm running into problems with setting the resolution:

Unexpected exception

com.ibm.team.repository.common.internal.ImmutablePropertyException
at com.ibm.team.repository.common.internal.util.ItemUtil$ProtectAdapter.notifyChanged(ItemUtil.java:2007)
at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:280)
at com.ibm.team.workitem.common.internal.model.impl.WorkItemImpl.setInternalResolution(WorkItemImpl.java:1107)
at com.ibm.team.workitem.common.internal.model.impl.WorkItemImpl.setResolution2(WorkItemImpl.java:1081)
at com.ibm.mrbuild.rtc.cli.internal.ResolveWorkItemCmd.run(ResolveWorkItemCmd.java:200)
at com.ibm.team.filesystem.cli.core.internal.SubcommandLauncher.run(SubcommandLauncher.java:622)
at com.ibm.team.filesystem.cli.core.internal.SubcommandLauncher.doStart(SubcommandLauncher.java:365)
at com.ibm.team.filesystem.cli.core.internal.SubcommandLauncher.run(SubcommandLauncher.java:148)
at com.ibm.team.filesystem.cli.core.internal.Application.start(Applicati
on.java:37)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:194)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runAppli
cation(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(Ec
lipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.ja
va:368)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.ja
va:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:600)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:559)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
at org.eclipse.equinox.launcher.Main.run(Main.java:1311


Any help or ideas would be appreciated.

9 answers



permanent link
Dhanya Saseendran (8831421) | answered May 05 '11, 9:06 a.m.
Hi All,

I have a dataset which is join from three datasets.
ie. A join from the first two dataset again joined with another.
The result when viewed the Preview is fine. But when I upload it to the server or run the 'View Report' as an XLS or any other, I am not able to view the output of this join dataset.

Is this a bug? I tried with different examples. Join of the first two dataset does not have this problem. But when it is joined with a third dataset, it is having this issue.

Can somebody verify if this happens to them?

Note: I am using RTC 2.0.0.2
Thanks
Dhanya

permanent link
Dhanya Saseendran (8831421) | answered May 05 '11, 9:07 a.m.
Hi All,

I have a dataset which is join from three datasets.
ie. A join from the first two dataset again joined with another.
The result when viewed the Preview is fine. But when I upload it to the server or run the 'View Report' as an XLS or any other, I am not able to view the output of this join dataset.

Is this a bug? I tried with different examples. Join of the first two dataset does not have this problem. But when it is joined with a third dataset, it is having this issue.

Can somebody verify if this happens to them?

Note: I am using RTC 2.0.0.2
Thanks
Dhanya


All,
Accidently posted as the reply.
Sorry about this.

permanent link
Jeff Care (1.0k3833) | answered May 11 '11, 12:11 p.m.
Any ideas on this from the community?

I'm trying to modify the state and resolution of a work item using the 3.0 SDK.

Here's the relevant code:

    final IWorkItemWorkingCopyManager wiwcManager = wiClient.getWorkItemWorkingCopyManager ();


try {

wiwcManager.connect (workitem, IWorkItem.SMALL_PROFILE, getMonitor ());
}
catch (final TeamRepositoryException exp) {

throw StatusHelper.wrap ("failed to connect to work item working copy",
exp,
new IndentingPrintStream (stderr ()));
}

final WorkItemWorkingCopy wiwc = wiwcManager.getWorkingCopy (workitem);
wiwc.setWorkflowAction (action.getStringIdentifier ());

if (resolution != null)
wiwc.getWorkItem ().setResolution2 (resolution);

final IDetailedStatus status = wiwc.save (getMonitor ());
wiwcManager.disconnect (workitem);

if (!status.isOK ())
throw new FileSystemStatusException (status);


Modifying the state by setting an action works okay but I'm running into problems with setting the resolution:

Unexpected exception

com.ibm.team.repository.common.internal.ImmutablePropertyException
at com.ibm.team.repository.common.internal.util.ItemUtil$ProtectAdapter.notifyChanged(ItemUtil.java:2007)
at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:280)
at com.ibm.team.workitem.common.internal.model.impl.WorkItemImpl.setInternalResolution(WorkItemImpl.java:1107)
at com.ibm.team.workitem.common.internal.model.impl.WorkItemImpl.setResolution2(WorkItemImpl.java:1081)
at com.ibm.mrbuild.rtc.cli.internal.ResolveWorkItemCmd.run(ResolveWorkItemCmd.java:200)
at com.ibm.team.filesystem.cli.core.internal.SubcommandLauncher.run(SubcommandLauncher.java:622)
at com.ibm.team.filesystem.cli.core.internal.SubcommandLauncher.doStart(SubcommandLauncher.java:365)
at com.ibm.team.filesystem.cli.core.internal.SubcommandLauncher.run(SubcommandLauncher.java:148)
at com.ibm.team.filesystem.cli.core.internal.Application.start(Applicati
on.java:37)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:194)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runAppli
cation(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(Ec
lipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.ja
va:368)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.ja
va:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:600)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:559)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
at org.eclipse.equinox.launcher.Main.run(Main.java:1311


Any help or ideas would be appreciated.

permanent link
Jeff Care (1.0k3833) | answered May 12 '11, 11:11 p.m.
Bump.

Any ideas on this from the community?

I'm trying to modify the state and resolution of a work item using the 3.0 SDK.

Here's the relevant code:

    final IWorkItemWorkingCopyManager wiwcManager = wiClient.getWorkItemWorkingCopyManager ();


try {

wiwcManager.connect (workitem, IWorkItem.SMALL_PROFILE, getMonitor ());
}
catch (final TeamRepositoryException exp) {

throw StatusHelper.wrap ("failed to connect to work item working copy",
exp,
new IndentingPrintStream (stderr ()));
}

final WorkItemWorkingCopy wiwc = wiwcManager.getWorkingCopy (workitem);
wiwc.setWorkflowAction (action.getStringIdentifier ());

if (resolution != null)
wiwc.getWorkItem ().setResolution2 (resolution);

final IDetailedStatus status = wiwc.save (getMonitor ());
wiwcManager.disconnect (workitem);

if (!status.isOK ())
throw new FileSystemStatusException (status);


Modifying the state by setting an action works okay but I'm running into problems with setting the resolution:

Unexpected exception

com.ibm.team.repository.common.internal.ImmutablePropertyException
at com.ibm.team.repository.common.internal.util.ItemUtil$ProtectAdapter.notifyChanged(ItemUtil.java:2007)
at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:280)
at com.ibm.team.workitem.common.internal.model.impl.WorkItemImpl.setInternalResolution(WorkItemImpl.java:1107)
at com.ibm.team.workitem.common.internal.model.impl.WorkItemImpl.setResolution2(WorkItemImpl.java:1081)
at com.ibm.mrbuild.rtc.cli.internal.ResolveWorkItemCmd.run(ResolveWorkItemCmd.java:200)
at com.ibm.team.filesystem.cli.core.internal.SubcommandLauncher.run(SubcommandLauncher.java:622)
at com.ibm.team.filesystem.cli.core.internal.SubcommandLauncher.doStart(SubcommandLauncher.java:365)
at com.ibm.team.filesystem.cli.core.internal.SubcommandLauncher.run(SubcommandLauncher.java:148)
at com.ibm.team.filesystem.cli.core.internal.Application.start(Applicati
on.java:37)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:194)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runAppli
cation(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(Ec
lipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.ja
va:368)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.ja
va:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:600)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:559)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
at org.eclipse.equinox.launcher.Main.run(Main.java:1311


Any help or ideas would be appreciated.

permanent link
Eduardo Bello (4401922) | answered May 16 '11, 4:35 p.m.
It may seem silly, but you must specify whether a state has or not a resolution. What may be happening is that the state you are configuring has no resolution, so this property is immutable.

permanent link
Jeff Care (1.0k3833) | answered May 16 '11, 10:13 p.m.
It may seem silly, but you must specify whether a state has or not a resolution. What may be happening is that the state you are configuring has no resolution, so this property is immutable.


IWorkItem.setState2 is marked as deprecated, advising that WorkItemWorkingCopy.setWorkFlowAction should be used instead; that's what I'm using and that works for setting the state but I can't control the resolution.

I know that the resolution I'm attempting to set is valid for the resolved state (in my test the work item is moving from open to resolved state via the "resolve" action).

permanent link
Eduardo Bello (4401922) | answered May 17 '11, 10:58 a.m.
It may seem silly, but you must specify whether a state has or not a resolution. What may be happening is that the state you are configuring has no resolution, so this property is immutable.


IWorkItem.setState2 is marked as deprecated, advising that WorkItemWorkingCopy.setWorkFlowAction should be used instead; that's what I'm using and that works for setting the state but I can't control the resolution.

I know that the resolution I'm attempting to set is valid for the resolved state (in my test the work item is moving from open to resolved state via the "resolve" action).


I'm just guessing here, but you could try to set the resolution (not saving) before calling the action and saving the WI, or you could save it without setting the resolution then reload it (get working copy again) and try to set the resolution.

I don't work with client libraries, just server side. But in some cases I do (wrongly) use IWorkItem.setState2() because some states transitions shouldn't be visible to our users, so I can't set action.

permanent link
Andre Weinand (4811) | answered May 19 '11, 12:53 p.m.
Your code looks correct to me: you are setting the workflow action and the resolution on a WorkItemWorkingCopy.
The ImmutablePropertyException shows that the workitem behind the WorkItemWorkingCopy is immutable (readonly).
Could it be that you are trying to modify an immutable workitem?

The reason why you are able to set the action but not the resolution is simple:
the resolution is a real attribute of the work item whereas the workflow action is a transient attribute of the WorkItemWorkingCopy that is only used inside WorkItemWorkingCopy.save() to trigger the state transition.

--andre


Andre Weinand
Work Item Team

permanent link
Jeff Care (1.0k3833) | answered Jun 01 '11, 4:23 p.m.
How does the GUI accomplish this task? I can modify the state & resolution of the same work item with the GUI.

Your code looks correct to me: you are setting the workflow action and the resolution on a WorkItemWorkingCopy.
The ImmutablePropertyException shows that the workitem behind the WorkItemWorkingCopy is immutable (readonly).
Could it be that you are trying to modify an immutable workitem?

The reason why you are able to set the action but not the resolution is simple:
the resolution is a real attribute of the work item whereas the workflow action is a transient attribute of the WorkItemWorkingCopy that is only used inside WorkItemWorkingCopy.save() to trigger the state transition.

--andre


Andre Weinand
Work Item Team

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.