I am running this introductory workshop in Barcelona at the end of April.
Details Here
Tuesday, March 25, 2014
Wednesday, March 19, 2014
Tuesday, March 18, 2014
Monday, March 17, 2014
#311 Happy St. Patrick's Day from Maui
Off for the month of March for some well deserved R&R.
Spend today on the well worn road to Hana, instead of parading like the rest of the Irish diaspora.
So until April!
Spend today on the well worn road to Hana, instead of parading like the rest of the Irish diaspora.
So until April!
Tuesday, February 11, 2014
#309 Adaptive Case Management API - part 6 - archiving the audit trail to Biz DB ++
As you can see, the audit table now includes a comments column.
now to the format of the comments -
*** comments are generated by my auditing utility.
auto... are comments from Oracle Business Rules
The rest are comments entered by the case worker via the UI.
The code -
Now we can further refine this to get the following output for all event types -
JDev project Here
Monday, February 10, 2014
#308 Adaptive Case Management API - part 5 - archiving the audit trail to Biz DB
Leading on from the previous post -
I now detail a basic example of archiving the case audit trail to a Biz DB.
I created the following table in my Biz schema
AUDIT_TIME is defined as TIMESTAMP the rest are varchars.
I now create a utility class to do the DB insert -
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.sql.Timestamp;
import java.util.Date;
public class AuditBizDB {
public AuditBizDB() {
super();
}
public String writeAudit2DB(String caseId, Date auditDate, String msgType, String msg) {
Connection conn = null;
Timestamp auditDateTime = getTimestamp(auditDate);
try {
conn =
DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe",
"niall", "niall");
PreparedStatement insertAudit = null;
String insertSQL =
"INSERT INTO NIALL.AUDIT4CASE (CASE_ID, AUDIT_TIME, AUDIT_MSG, AUDIT_MSG_TYPE) VALUES (?, ?, ?, ? )";
insertAudit = conn.prepareStatement(insertSQL);
insertAudit.setString(1, caseId);
insertAudit.setTimestamp(2, auditDateTime );
insertAudit.setString(3, msg);
insertAudit.setString(4, msgType);
insertAudit.execute();
conn.commit();
conn.close();
} catch (SQLException e) {
System.out.println("Connection Failed! Check output console");
e.printStackTrace();
}
return "success";
}
private static java.sql.Timestamp getTimestamp(java.util.Date today) {
return new java.sql.Timestamp(today.getTime());
}
}
etc.
I re-run my tester and see the following output in my DB.
I now detail a basic example of archiving the case audit trail to a Biz DB.
I created the following table in my Biz schema
AUDIT_TIME is defined as TIMESTAMP the rest are varchars.
I now create a utility class to do the DB insert -
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.sql.Timestamp;
import java.util.Date;
public class AuditBizDB {
public AuditBizDB() {
super();
}
public String writeAudit2DB(String caseId, Date auditDate, String msgType, String msg) {
Connection conn = null;
Timestamp auditDateTime = getTimestamp(auditDate);
try {
conn =
DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe",
"niall", "niall");
PreparedStatement insertAudit = null;
String insertSQL =
"INSERT INTO NIALL.AUDIT4CASE (CASE_ID, AUDIT_TIME, AUDIT_MSG, AUDIT_MSG_TYPE) VALUES (?, ?, ?, ? )";
insertAudit = conn.prepareStatement(insertSQL);
insertAudit.setString(1, caseId);
insertAudit.setTimestamp(2, auditDateTime );
insertAudit.setString(3, msg);
insertAudit.setString(4, msgType);
insertAudit.execute();
conn.commit();
conn.close();
} catch (SQLException e) {
System.out.println("Connection Failed! Check output console");
e.printStackTrace();
}
return "success";
}
private static java.sql.Timestamp getTimestamp(java.util.Date today) {
return new java.sql.Timestamp(today.getTime());
}
}
I call this from the existing auditing methods of my CaseAPI client -
etc.
I re-run my tester and see the following output in my DB.
Subscribe to:
Posts (Atom)