Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Reporting an error in an operation participant

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

0 votes



7 answers

Permanent link
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.

0 votes


Permanent link
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

0 votes


Permanent link
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?

0 votes


Permanent link
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

0 votes


Permanent link
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

0 votes


Permanent link
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

0 votes


Permanent link
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

0 votes

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,938

Question asked: Aug 31 '10, 11:35 p.m.

Question was seen: 7,904 times

Last updated: Aug 31 '10, 11:35 p.m.

Confirmation Cancel Confirm