It's all about the answers!

Ask a question

Reporting an error in an operation participant


Geoff Alexander (19623947) | asked Aug 31 '10, 11:35 p.m.
How does one report an error in an operation participant when there's no exception? IParticipantInfoCollector has only two methods: IReportInfo createInfo(String summary, String description) and IReportInfo createExceptionInfo(String summary, Throwable exception).

I tried the following:
IReportInfo info = collector.createInfo( "summary", "description" );

collector.addInfo( info );

This doesn't work as IParticipantInfoCollector#createInfo(String summary, String description) sets the returned IReportInfo instance's identity to IParticipantInfoCollector.ID_PARTICIPANT_INFO and severity to IProcessReport.OK.

Thanks,
Geoff Alexander

7 answers



permanent link
Thomas Yu (45183) | answered Sep 09 '10, 12:28 a.m.
How does one report an error in an operation participant when there's no exception? IParticipantInfoCollector has only two methods: IReportInfo createInfo(String summary, String description)
and IReportInfo createExceptionInfo(String summary, Throwable exception).

I tried the following:
IReportInfo info = collector.createInfo( "summary", "description" );

collector.addInfo( info );

This doesn't work as IParticipantInfoCollector#createInfo(String summary, String description) sets the returned IReportInfo instance's identity to IParticipantInfoCollector.ID_PARTICIPANT_INFO and severity to IProcessReport.OK.

Thanks,
Geoff Alexander

Hi Geoff,
I think there are 2 workround for this:
1).Is it possible for you to wrap the error message into an Exception? This maybe the quickest solution.
2).As you pointed out, when you get the IReportInfo object, you can use its setSeverity to set the severity to IProcessReport.ERROR.But unfortunely, you can't set the indentifier.
So, I think you can use 1) as the workround.

permanent link
Geoff Alexander (19623947) | answered Sep 09 '10, 2:37 p.m.
How does one report an error in an operation participant when there's no exception? IParticipantInfoCollector has only two methods: IReportInfo createInfo(String summary, String description)
and IReportInfo createExceptionInfo(String summary, Throwable exception).

I tried the following:
IReportInfo info = collector.createInfo( "summary", "description" );

collector.addInfo( info );

This doesn't work as IParticipantInfoCollector#createInfo(String summary, String description) sets the returned IReportInfo instance's identity to IParticipantInfoCollector.ID_PARTICIPANT_INFO and severity to IProcessReport.OK.

Thanks,
Geoff Alexander

Hi Geoff,
I think there are 2 workround for this:
1).Is it possible for you to wrap the error message into an Exception? This maybe the quickest solution.
2).As you pointed out, when you get the IReportInfo object, you can use its setSeverity to set the severity to IProcessReport.ERROR.But unfortunely, you can't set the indentifier.
So, I think you can use 1) as the workround.

Thomas,

Thanks for getting back to me.

I'm using workaround 2 for now. Even though I can't set the identifier, the workaround seems to work. One problem is that the setSeverity method is not in IReportInfo but rather in ReportInfo, which is an internal class. This results in a number of "Discouraged access" warnings.

Should I open a Defect for this problem? Or does a Defect already exist?

Thanks,
Geoff Alexander

permanent link
Thomas Yu (45183) | answered Sep 09 '10, 9:43 p.m.
How does one report an error in an operation participant when there's no exception? IParticipantInfoCollector has only two methods: IReportInfo createInfo(String summary, String description)
and IReportInfo createExceptionInfo(String summary, Throwable exception).

I tried the following:
IReportInfo info = collector.createInfo( "summary", "description" );

collector.addInfo( info );

This doesn't work as IParticipantInfoCollector#createInfo(String summary, String description) sets the returned IReportInfo instance's identity to IParticipantInfoCollector.ID_PARTICIPANT_INFO and severity to IProcessReport.OK.

Thanks,
Geoff Alexander

Hi Geoff,
I think there are 2 workround for this:
1).Is it possible for you to wrap the error message into an Exception? This maybe the quickest solution.
2).As you pointed out, when you get the IReportInfo object, you can use its setSeverity to set the severity to IProcessReport.ERROR.But unfortunely, you can't set the indentifier.
So, I think you can use 1) as the workround.

Thomas,

Thanks for getting back to me.

I'm using workaround 2 for now. Even though I can't set the identifier, the workaround seems to work. One problem is that the setSeverity method is not in IReportInfo but rather in ReportInfo, which is an internal class. This results in a number of "Discouraged access" warnings.

Should I open a Defect for this problem? Or does a Defect already exist?

Thanks,
Geoff Alexander

Hi Geoff,

I look through the IReportInfo interface, and setSeverity method is indeed exposed there,could you please double check it?

permanent link
Geoff Alexander (19623947) | answered Sep 10 '10, 11:46 a.m.
How does one report an error in an operation participant when there's no exception? IParticipantInfoCollector has only two methods: IReportInfo createInfo(String summary, String description)
and IReportInfo createExceptionInfo(String summary, Throwable exception).

I tried the following:
IReportInfo info = collector.createInfo( "summary", "description" );

collector.addInfo( info );

This doesn't work as IParticipantInfoCollector#createInfo(String summary, String description) sets the returned IReportInfo instance's identity to IParticipantInfoCollector.ID_PARTICIPANT_INFO and severity to IProcessReport.OK.

Thanks,
Geoff Alexander

Hi Geoff,
I think there are 2 workround for this:
1).Is it possible for you to wrap the error message into an Exception? This maybe the quickest solution.
2).As you pointed out, when you get the IReportInfo object, you can use its setSeverity to set the severity to IProcessReport.ERROR.But unfortunely, you can't set the indentifier.
So, I think you can use 1) as the workround.

Thomas,

Thanks for getting back to me.

I'm using workaround 2 for now. Even though I can't set the identifier, the workaround seems to work. One problem is that the setSeverity method is not in IReportInfo but rather in ReportInfo, which is an internal class. This results in a number of "Discouraged access" warnings.

Should I open a Defect for this problem? Or does a Defect already exist?

Thanks,
Geoff Alexander

Hi Geoff,

I look through the IReportInfo interface, and setSeverity method is indeed exposed there,could you please double check it?

Thomas,

You are indeed correct. I'm not sure why I missed it before. Changing my code to use the setSeverity method from IReportInfo eliminated the "Discouraged access" warnings. Thanks for pointing this out.

Geoff Alexander

permanent link
Jared Burns (4.5k29) | answered Sep 16 '10, 12:16 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
On Fri, 10 Sep 2010 15:53:03 +0000, gdlxn wrote:

Thomas,

You are indeed correct. I'm not sure why I missed it before. Changing
my code to use the setSeverity method from IReportInfo eliminated the
"Discouraged access" warnings. Thanks for pointing this out.

Geoff Alexander

Geoff, can you explain why you need to report an "error" from a follow-up
action that isn't an exception? What is an example of an error you want
to report?

Thanks,
- Jared
---------------------
Jazz Team Process

permanent link
Geoff Alexander (19623947) | answered Sep 20 '10, 10:08 a.m.
Geoff, can you explain why you need to report an "error" from a follow-up
action that isn't an exception? What is an example of an error you want
to report?

Thanks,
- Jared
---------------------
Jazz Team Process


Jared,

I'm using a follow-up action to keep my custom work items and an external repository in sync. It's possible that I may receive an error from the external repository, which I need to report. I guess I could "report" the error via an exception. Using an exception just didn't seem necessary in this case.

Geoff Alexander

permanent link
Jared Burns (4.5k29) | answered Sep 22 '10, 12:17 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
On Mon, 20 Sep 2010 14:23:02 +0000, gdlxn wrote:

Jaredwrote:
Geoff, can you explain why you need to report an "error" from a
follow-up
action that isn't an exception? What is an example of an error you
want
to report?

Thanks,
- Jared
---------------------
Jazz Team Process

Jared,

I'm using a follow-up action to keep my custom work items and an
external repository in sync. It's possible that I may receive an error
from the external repository, which I need to report. I guess I could
"report" the error via an exception. Using an exception just didn't
seem necessary in this case.

Geoff Alexander

If you want to report an error like this from a precondition, you should
use an exception. Just understand that reporting an exception from a
follow-up action will actually stop the whole operation from proceeding.
In this case, it will roll back the save of the workitem.

One more thing. It may be more work than you're looking to do, but
there's an extensible mechanism in RTC for syncing items between RTC and
an external repository. You might want to have a look at: https://
jazz.net/wiki/bin/view/Main/ItemConnectorCreation

- Jared
---------------------
Jazz Team Process

Your answer


Register or to post your answer.