|
Oracle Fusion Middleware Java API Reference for Oracle BPM Suite 11g Release 1 (11.1.1.7.0) E25378-07 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object oracle.bpm.services.tools.ProcessInstanceAuditHelper
public class ProcessInstanceAuditHelper
This class is a helper to operate with the ProcessInstance audit data.
Samples:
String host = "host.domain.com";
String port = "7001";
String ejbHost = "t3://" + host + ":" + port;
String user = "weblogic";
char[] password = "weblogic1".toCharArray();
String instanceId = "21004";
String componentDN = "default/MyBPMProject!1.0*soa_35304fdc-807b-49c8-b8e5-70b6accfbede/MyProcess";
BPMServiceClientFactory bpmServiceClientFactory = null;
IBPMContext bpmContext = null;
try {
Map
new HashMap
properties.put(IWorkflowServiceClientConstants.CONNECTION_PROPERTY.CLIENT_TYPE,
WorkflowServiceClientFactory.REMOTE_CLIENT);
properties.put(IWorkflowServiceClientConstants.CONNECTION_PROPERTY.EJB_PROVIDER_URL, ejbHost);
properties.put(IWorkflowServiceClientConstants.CONNECTION_PROPERTY.EJB_INITIAL_CONTEXT_FACTORY,
"weblogic.jndi.WLInitialContextFactory");
System.out.print("-> Creating BPM Service Client Factory ...");
bpmServiceClientFactory = BPMServiceClientFactory.getInstance(properties, null, null);
System.out.println("OK");
System.out.print("-> Authenticating user [" + user + "] ...");
bpmContext =
bpmServiceClientFactory.getBPMUserAuthenticationService().authenticate(user, password, null);
System.out.println("OK");
System.out.print("-> Getting BPM Service Client");
IBPMServiceClient bpmServiceClient = bpmServiceClientFactory.getBPMServiceClient();
System.out.println("OK");
System.out.print("-> Getting Process Image ...");
OutputStream processImageOutputStream =
ProcessInstanceAuditHelper.getProcessImage(bpmContext, bpmServiceClient, componentDN);
System.out.println("OK");
System.out.print("-> Getting Audit Instance Image ...");
OutputStream auditImageOutputStream =
ProcessInstanceAuditHelper.getAuditImage(bpmContext, bpmServiceClient, instanceId);
System.out.println("OK");
System.out.print("-> Getting Audit Instance XML ...");
String auditInstanceXML =
ProcessInstanceAuditHelper.getAuditXml(bpmContext, bpmServiceClient, instanceId);
System.out.println("OK");
System.out.print("-> Getting Audit Trail tree...");
AuditTrail auditTrail =
ProcessInstanceAuditHelper.getAuditTrail(bpmContext, bpmServiceClient, instanceId);
System.out.println("OK");
}
catch (Exception exception) {
System.out.println("FAIL");
exception.printStackTrace();
}
finally {
if (bpmServiceClientFactory != null && bpmContext != null) {
try {
System.out.print("-> Destroying BPM Context [" + bpmContext.getUser() + "] ...");
bpmServiceClientFactory.getBPMUserAuthenticationService().destroyBPMContext(bpmContext);
System.out.println("OK");
}
catch (Exception exception) {
System.out.println("FAIL");
exception.printStackTrace();
}
}
}
Constructor Summary | |
---|---|
ProcessInstanceAuditHelper()
|
Method Summary | |
---|---|
java.io.OutputStream |
getAuditImage(IBPMContext bpmContext,
IBPMServiceClient bpmServiceClient,
java.lang.String processInstance)
Returns the audit trail image of the given instance. |
oracle.bpm.services.util.AuditTrail |
getAuditTrail(IBPMContext bpmContext,
IBPMServiceClient bpmServiceClient,
java.lang.String processInstance)
Returns the Audit Trail object for the given instance. |
java.lang.String |
getAuditXml(IBPMContext bpmContext,
IBPMServiceClient bpmServiceClient,
java.lang.String processInstance)
Returns an XML representation of the Audit Trail for the given instance. |
java.io.OutputStream |
getProcessImage(IBPMContext bpmContext,
IBPMServiceClient bpmServiceClient,
java.lang.String process)
Returns the image of the given process. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ProcessInstanceAuditHelper()
Method Detail |
---|
public java.io.OutputStream getProcessImage(IBPMContext bpmContext, IBPMServiceClient bpmServiceClient, java.lang.String process) throws java.lang.Exception
bpmContext
- Authenticated context.bpmServiceClient
- BPM Service Client to obtain the necessary services.process
- Process Id (Composite DN).
java.lang.Exception
- if the operation fails.
ex.
String host = "host.domain.com";
String port = "7001";
String ejbHost = "t3://" + host + ":" + port;
String user = "weblogic";
char[] password = "weblogic1".toCharArray();
String componentDN = "default/MyBPMProject!1.0*soa_35304fdc-807b-49c8-b8e5-70b6accfbede/MyProcess";
Map properties =
new HashMap();
properties.put(IWorkflowServiceClientConstants.CONNECTION_PROPERTY.CLIENT_TYPE,
WorkflowServiceClientFactory.REMOTE_CLIENT);
properties.put(IWorkflowServiceClientConstants.CONNECTION_PROPERTY.EJB_PROVIDER_URL, ejbHost);
properties.put(IWorkflowServiceClientConstants.CONNECTION_PROPERTY.EJB_INITIAL_CONTEXT_FACTORY,
"weblogic.jndi.WLInitialContextFactory");
System.out.print("-> Creating BPM Service Client Factory ...");
BPMServiceClientFactory bpmServiceClientFactory =
BPMServiceClientFactory.getInstance(properties, null, null);
System.out.println("OK");
System.out.print("-> Authenticating user [" + user + "] ...");
IBPMContext bpmContext =
bpmServiceClientFactory.getBPMUserAuthenticationService().authenticate(user, password, null);
System.out.println("OK");
System.out.print("-> Getting BPM Service Client");
IBPMServiceClient bpmServiceClient = bpmServiceClientFactory.getBPMServiceClient();
System.out.println("OK");
System.out.print("-> Getting Process Image ...");
OutputStream processImageOutputStream =
ProcessInstanceAuditHelper.getProcessImage(bpmContext, bpmServiceClient, componentDN);
System.out.println("OK");
public java.io.OutputStream getAuditImage(IBPMContext bpmContext, IBPMServiceClient bpmServiceClient, java.lang.String processInstance) throws java.lang.Exception
bpmContext
- Authenticated context.bpmServiceClient
- BPM Service Client to obtain the necessary services.processInstance
- Process Instance Id.
java.lang.Exception
- if the operation fails.
ex.
String host = "host.domain.com";
String port = "7001";
String ejbHost = "t3://" + host + ":" + port;
String user = "weblogic";
char[] password = "weblogic1".toCharArray();
String instanceId = "21004";
Map properties =
new HashMap();
properties.put(IWorkflowServiceClientConstants.CONNECTION_PROPERTY.CLIENT_TYPE,
WorkflowServiceClientFactory.REMOTE_CLIENT);
properties.put(IWorkflowServiceClientConstants.CONNECTION_PROPERTY.EJB_PROVIDER_URL, ejbHost);
properties.put(IWorkflowServiceClientConstants.CONNECTION_PROPERTY.EJB_INITIAL_CONTEXT_FACTORY,
"weblogic.jndi.WLInitialContextFactory");
System.out.print("-> Creating BPM Service Client Factory ...");
BPMServiceClientFactory bpmServiceClientFactory =
BPMServiceClientFactory.getInstance(properties, null, null);
System.out.println("OK");
System.out.print("-> Authenticating user [" + user + "] ...");
IBPMContext bpmContext =
bpmServiceClientFactory.getBPMUserAuthenticationService().authenticate(user, password, null);
System.out.println("OK");
System.out.print("-> Getting BPM Service Client");
IBPMServiceClient bpmServiceClient = bpmServiceClientFactory.getBPMServiceClient();
System.out.println("OK");
System.out.print("-> Getting Audit Instance Image ...");
OutputStream auditImageOutputStream =
ProcessInstanceAuditHelper.getAuditImage(bpmContext, bpmServiceClient, instanceId);
System.out.println("OK");
public java.lang.String getAuditXml(IBPMContext bpmContext, IBPMServiceClient bpmServiceClient, java.lang.String processInstance) throws java.lang.Exception
bpmContext
- Authenticated context.bpmServiceClient
- BPM Service Client to obtain the necessary services.processInstance
- Process Instance Id to obtain its audit trail.
java.lang.Exception
- if the operation fails.
ex.
String host = "host.domain.com";
String port = "7001";
String ejbHost = "t3://" + host + ":" + port;
String user = "weblogic";
char[] password = "weblogic1".toCharArray();
String instanceId = "21004";
Map properties =
new HashMap();
properties.put(IWorkflowServiceClientConstants.CONNECTION_PROPERTY.CLIENT_TYPE,
WorkflowServiceClientFactory.REMOTE_CLIENT);
properties.put(IWorkflowServiceClientConstants.CONNECTION_PROPERTY.EJB_PROVIDER_URL, ejbHost);
properties.put(IWorkflowServiceClientConstants.CONNECTION_PROPERTY.EJB_INITIAL_CONTEXT_FACTORY,
"weblogic.jndi.WLInitialContextFactory");
System.out.print("-> Creating BPM Service Client Factory ...");
BPMServiceClientFactory bpmServiceClientFactory =
BPMServiceClientFactory.getInstance(properties, null, null);
System.out.println("OK");
System.out.print("-> Authenticating user [" + user + "] ...");
IBPMContext bpmContext =
bpmServiceClientFactory.getBPMUserAuthenticationService().authenticate(user, password, null);
System.out.println("OK");
System.out.print("-> Getting BPM Service Client");
IBPMServiceClient bpmServiceClient = bpmServiceClientFactory.getBPMServiceClient();
System.out.println("OK");
System.out.print("-> Getting Audit Instance XML ...");
String auditInstanceXML =
ProcessInstanceAuditHelper.getAuditXml(bpmContext, bpmServiceClient, instanceId);
System.out.println("OK");
public oracle.bpm.services.util.AuditTrail getAuditTrail(IBPMContext bpmContext, IBPMServiceClient bpmServiceClient, java.lang.String processInstance) throws java.lang.Exception
bpmContext
- Authenticated context.bpmServiceClient
- BPM Service Client to obtain the necessary services.processInstance
- Process Instance ID to obtain its Audit Trail.
java.lang.Exception
- if the operation fails.
ex.
String host = "host.domain.com";
String port = "7001";
String ejbHost = "t3://" + host + ":" + port;
String user = "weblogic";
char[] password = "weblogic1".toCharArray();
String instanceId = "21004";
Map properties =
new HashMap();
properties.put(IWorkflowServiceClientConstants.CONNECTION_PROPERTY.CLIENT_TYPE,
WorkflowServiceClientFactory.REMOTE_CLIENT);
properties.put(IWorkflowServiceClientConstants.CONNECTION_PROPERTY.EJB_PROVIDER_URL, ejbHost);
properties.put(IWorkflowServiceClientConstants.CONNECTION_PROPERTY.EJB_INITIAL_CONTEXT_FACTORY,
"weblogic.jndi.WLInitialContextFactory");
System.out.print("-> Creating BPM Service Client Factory ...");
BPMServiceClientFactory bpmServiceClientFactory =
BPMServiceClientFactory.getInstance(properties, null, null);
System.out.println("OK");
System.out.print("-> Authenticating user [" + user + "] ...");
IBPMContext bpmContext =
bpmServiceClientFactory.getBPMUserAuthenticationService().authenticate(user, password, null);
System.out.println("OK");
System.out.print("-> Getting BPM Service Client");
IBPMServiceClient bpmServiceClient = bpmServiceClientFactory.getBPMServiceClient();
System.out.println("OK");
System.out.print("-> Getting Audit Trail tree...");
AuditTrail auditTrail =
ProcessInstanceAuditHelper.getAuditTrail(bpmContext, bpmServiceClient, instanceId);
System.out.println("OK");
|
Oracle Fusion Middleware Java API Reference for Oracle BPM Suite 11g Release 1 (11.1.1.7.0) E25378-07 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |