Adding a log to the BPEL Audit Trail
Throughout the recipes in this chapter we saw quite a few lines of auditing (addAuditTrailEntry
). We did not explore them in any of the recipes, as this recipe is dedicated to exploring the possibilities of auditing in the Java Embedding activity.
How to do it…
Open the BPEL_and_Java_1_1
process and insert the Java Embedding activity (Auditing
).
We insert the code into a snippet as follows:
- Initially, we read the content of the input data. Note that we added the auditing method that outputs the input variable content:
Object input_obj= getVariableData("Input_Txt_Var"); addAuditTrailEntry("Input data", input_obj);
- In the try/catch block, we convert the content of the input variable to a double number. If the type of input variable content presents a number, we audit the converted number, otherwise we report the exception that occurred during the transformation:
try { Double whatNumber = Double.parseDouble((String)input_obj)...