Hello,
In my servicecallout i'm trying to create a Violation-message after caching a null-pointer exception. I'm using Corticon 5.5.2.14.
I tried the following code in my catch-block, but my decisionservice completes without a violation-message :
Writer sw = new StringWriter();
e.printStackTrace(new PrintWriter(sw));
dataObjectManager.logViolation(sw.toString(), "Magi_FilingUnit_SCO");
By means of a log4j-message i've already checked that the code within the catch-block is really executed.
Does anybody know the right approach?
Thank you,
Bartel
I stand corrected,
ICcDataObjectManager.postMessage(java.lang.String astrSeverity, java.lang.String astrMsg, ICcDataObject aEntity)
seems like what you want
Bartel,
The method you're calling is write to the log file, not to create a rule message. I don't think we expose an API for doing that form a SCO.
Jim
Right - you cannot create a Corticon Rule message from the APIs. Though that would be really convenient if you could.
However you can define an entity in your vocabulary (called Exception) then you can create it and populate it from your API.
eg
catch (Throwable e)
{
ICcDataObject msg = aDataObjMgr.createEntity("Exception");
msg.setAttributeValue("text", e.getMessage());
e.printStackTrace();
} // End of try importRulesheets
Maarten
Joosen
informatie analist
Straatweg 2 | |||
|
3604 BB Maarssen | ||
mjoosen@benuapotheek.nl | Postbus 75 | ||
3600 AB Maarssen |
|
PROPERTY_EXECUTION_RESTRICT_RULEMESSAGES_INFO
|
PROPERTY_EXECUTION_RESTRICT_RULEMESSAGES_WARNING
|
PROPERTY_EXECUTION_RESTRICT_RULEMESSAGES_VIOLATION
|
PROPERTY_EXECUTION_RESTRICT_ RESPONSE_TO_RULEMESSAGES_ONLY
|
I stand corrected,
ICcDataObjectManager.postMessage(java.lang.String astrSeverity, java.lang.String astrMsg, ICcDataObject aEntity)
seems like what you want
Thank you James,
Works like a charm!
Greetings,
Bartel