Welcome Guest! Log in
×

Notice

The forum is in read only mode.
Stambia versions 2.x, 3.x, S17, S18, S19 and S20 are reaching End of Support January, 15th, 2024. Please consider upgrading to the supported Semarchy xDI versions. See Global Policy Support and the Semarchy Documentation.

The Stambia User Community is moving to Semarchy! All the applicable resources have already been moved or are currently being moved to their new location. Read more…

Topic-icon Deleted Retrieving the error message

More
22 May 2015 11:36 #1 by ikafai
Retrieving the error message was created by ikafai
HI,

How can I retrieve the error message of an action ?

Regards
More
01 Jun 2015 15:10 #2 by Thomas BLETON
Replied by Thomas BLETON on topic Retrieving the error message
Can you be more precise please ?
Is it that you want to read the error message ? Or you want to get it in a variable and use it after ? Or you want to send it by email ? or to a file ?
More
01 Jun 2015 15:22 #3 by ikafai
Replied by ikafai on topic Retrieving the error message
Hi Thomas,
I want to save it in a table, and then send it by email.
More
01 Jun 2015 17:46 #4 by Thomas BLETON
Replied by Thomas BLETON on topic Retrieving the error message
When an action has an error, these variables are set like this :
- CORE_RET_CODE = -1
- CORE_RET_MESS = a single line error message
- CORE_STACK_TRACE = a more detailed error (java stack trace in most cases)

You can refer to these variables from a SqlOperation like this :
INSERT INTO yourtable VALUES (${../ACTION_NAME/CORE_RET_CODE}$, '${../ACTION_NAME/CORE_RET_MESS}$')

(replace ACTION_NAME with the name of the action in error).

And then you can develop a process which reads the table and sends data by email.
More
16 Jun 2015 11:11 #5 by ikafai
Replied by ikafai on topic Retrieving the error message
Thanks Thomas, It Works
More
09 Jul 2015 13:54 #6 by Virginie_Samson
Replied by Virginie_Samson on topic Retrieving the error message
Hello
And what about, if you want to use it in a mapping?
Is it a different syntax?

Thanks
More
10 Jul 2015 16:00 #7 by Thomas BLETON
Replied by Thomas BLETON on topic Retrieving the error message
From a mapping, the syntax is the same.
The idea is to find the path to the desired action. The path to an action can be found in the CORE_PATH variable of the executed action.
More
19 Oct 2015 15:16 #8 by fvieillard
Replied by fvieillard on topic Retrieving the error message
Hi

Thanks for the tips on retrieveing the message.

Is there a way to retrieve the last error message, without knowing what ACTION it came from ?
I would actually like to manage any error in a specific subprocess, no matter where it occured. Is that possible, and what is the best way to do it according to you ?

Thanks !
More
19 Oct 2015 18:14 #9 by Thomas BLETON
Replied by Thomas BLETON on topic Retrieving the error message
Hello,
Actually this is possible with a Scripting action relying on the Runtime's API.
We can prepare an example of a tool which does this, in the next few days.
More
19 Oct 2015 18:24 #10 by fvieillard
Replied by fvieillard on topic Retrieving the error message
Hello

Thanks for your answer !
If it's not too complicated, I'd like to see an example :)

Will it be possible to write the result message to a variable and use it to insert into a table ?

Good evening,
François