Example Code - EnterWorks_Process_Exchange_(EPX) - 10.6

EnterWorks EPX Programmers Reference

Product type
Software
Portfolio
Verify
Product family
EnterWorks
Product
Precisely EnterWorks > EnterWorks Process Exchange (EPX)
Version
10.6
Language
English
Product name
Precisely EnterWorks
Title
EnterWorks EPX Programmers Reference
Topic type
Programming Reference
Reference
First publish date
2007

This example code demonstrates how a custom EPX application might leverage the audit entry API to create custom audit log entries in the EPX audit log, making use of the external system transaction context fields and the custom audit fields.

public AuditVO createAuditEntry()

throws com.enterworks.shared.exception.SecurityException

{

System.out.println( getMessage("audit.create") );

AuditVO auditVO = new AuditVO();

// what type of audit log entry information, error, or debug

auditVO.setAuditLevelCode(

String.valueOf(ESConstants.AUDIT_LEVEL_INFO), false);

// you can set a context about the object the audit log entry

// entry pertains to

auditVO.setObjectTypeCode(SessionVO.ENTITY_NAME,false);

// auditVO.setObjectName(SessionVO.ENTITY_NAME,false);

auditVO.setAuditObjectId(

new Integer(this.getSessionProfile().getSessionId()), false);

// provide some context about the server and the session

// the audit log entry pertains to

auditVO.setServerUid(

this.getServerProfile().getUID(), false);

auditVO.setSessionId(

new Integer(this.getSessionProfile().getSessionId()), false);

auditVO.setUserLogin(this.getSessionProfile().getUserLogin

(),false);

auditVO.setComponentCode(

String.valueOf(

ESConstants.S_PRODUCT_COMPONENT_NOT_SET), false);

// define the type of transaction code here

auditVO.setTransactionCode(

String.valueOf(

ESConstants.S_AUDIT_TRANSACTION_UPDATE), false);

// this field provides free form text for the audit log entry

auditVO.setAuditText(getMessage("audit.text"),false);

// the date and time of the audit log entry

auditVO.setAuditDatetime(new Date(),false);

// you can link audit log entries to an external system name,

// event and transaction identifier as shown below

auditVO.setSourceSystemName(

getMessage("audit.source.name"), false);

auditVO.setSourceSystemEvent(

getMessage("audit.source.event"), false);

auditVO.setSourceSystemId("PO-12345",false);

// you can set up to 10 custom audit text fields here

auditVO.setCustomText01(

getMessage("audit.custom.text") +"-01");

auditVO.setCustomText02(

getMessage("audit.custom.text") +"-02");

return auditFacade_.createAuditEntry(

this.getSessionProfile(),auditVO);

}