Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| jBPM distribution 6.2.0.Beta1
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jbpm.process.audit
Class JPAAuditLogService

    java.lang.Object
      org.jbpm.process.audit.JPAAuditLogService

All Implemented Interfaces:
  AuditLogService, AuditService

    public class JPAAuditLogService

extends Object
implements AuditLogService

The idea here is that we have a entity manager factory (similar to a session factory) that we repeatedly use to generate an entity manager (which is a persistence context) for the specific service command. While ProcessInstanceLog (and other *Log) entities do not contain LOB's (which sometimes necessitate the use of tx's even in read situations), we use transactions here none-the-less, just to be safe. Obviously, if there is already a running transaction present, we don't do anything to it. At the end of every command, we make sure to close the entity manager we've been using -- which also means that we detach any entities that might be associated with the entity manager/persistence context. After all, this is a service which means our philosophy here is to provide a real interface, and not a leaky one.

Constructor Summary
`JPAAuditLogService()`
`JPAAuditLogService(javax.persistence.EntityManagerFactory emf)`
`JPAAuditLogService(javax.persistence.EntityManagerFactory emf, PersistenceStrategyType type)`
`JPAAuditLogService(Environment env)`
`JPAAuditLogService(Environment env, PersistenceStrategyType type)`

Method Summary
`void` | `clear()` Removes all entries from audit data store
`void` | `dispose()` Indicates that work with this instance of `AuditService` is completed and can be disposed (release resources)
`List<ProcessInstanceLog>` | `findActiveProcessInstances(String processId)` Returns all active process instances for given process id
`List<NodeInstanceLog>` | `findNodeInstances(long processInstanceId)` Returns all node instances that were already triggered for given process instance id
`List<NodeInstanceLog>` | `findNodeInstances(long processInstanceId, String nodeId)` Returns all node instances that were already triggered for given process instance id and node identifier
`ProcessInstanceLog` | `findProcessInstance(long processInstanceId)` Returns process instance log for given process instance id
`List<ProcessInstanceLog>` | `findProcessInstances()` Service methods
`List<ProcessInstanceLog>` | `findProcessInstances(String processId)` Returns all known process instances for given process id
`List<ProcessInstanceLog>` | `findSubProcessInstances(long processInstanceId)` Returns all known subprocess instance logs for given process instance id - considered parent process instance id
`List<VariableInstanceLog>` | `findVariableInstances(long processInstanceId)` Returns all variable logs for given process instance id
`List<VariableInstanceLog>` | `findVariableInstances(long processInstanceId, String variableId)` Returns all variable logs for given process instance id and variable identifier
`List<VariableInstanceLog>` | `findVariableInstancesByName(String variableId, boolean onlyActiveProcesses)` Returns all variable logs that are identified by variable id regardless of what process instance they belong to
`List<VariableInstanceLog>` | `findVariableInstancesByNameAndValue(String variableId, String value, boolean onlyActiveProcesses)` Returns all variable logs that are identified by variable id and has given value regardless of what process instance they belong to
`String` | `getPersistenceUnitName()`
`void` | `setPersistenceUnitName(String persistenceUnitName)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### JPAAuditLogService

    public JPAAuditLogService()

### JPAAuditLogService

    public JPAAuditLogService(Environment env,
                              PersistenceStrategyType type)

### JPAAuditLogService

    public JPAAuditLogService(Environment env)

### JPAAuditLogService

    public JPAAuditLogService(javax.persistence.EntityManagerFactory emf)

### JPAAuditLogService

    public JPAAuditLogService(javax.persistence.EntityManagerFactory emf,
                              PersistenceStrategyType type)

Method Detail

### setPersistenceUnitName

    public void setPersistenceUnitName(String persistenceUnitName)

### getPersistenceUnitName

    public String getPersistenceUnitName()

### findProcessInstances

    public List<ProcessInstanceLog> findProcessInstances()

  Description copied from interface: `AuditLogService`
  Service methods

  Specified by:
    `findProcessInstances` in interface `AuditLogService`
  Specified by:
    `findProcessInstances` in interface `AuditService`
  Returns:
    all process instance logs or empty list if none were found

### findProcessInstances

    public List<ProcessInstanceLog> findProcessInstances(String processId)

  Description copied from interface: `AuditService`
  Returns all known process instances for given process id

  Specified by:
    `findProcessInstances` in interface `AuditLogService`
  Specified by:
    `findProcessInstances` in interface `AuditService`
  Parameters:
    `processId` - identifier of the process definition
  Returns:
    all process instance logs for given process id or empty list if none were found

### findActiveProcessInstances

    public List<ProcessInstanceLog> findActiveProcessInstances(String processId)

  Description copied from interface: `AuditService`
  Returns all active process instances for given process id

  Specified by:
    `findActiveProcessInstances` in interface `AuditLogService`
  Specified by:
    `findActiveProcessInstances` in interface `AuditService`
  Parameters:
    `processId` - identifier of the process definition
  Returns:
    all active process instance logs for given process id or empty list if none were found

### findProcessInstance

    public ProcessInstanceLog findProcessInstance(long processInstanceId)

  Description copied from interface: `AuditService`
  Returns process instance log for given process instance id

  Specified by:
    `findProcessInstance` in interface `AuditLogService`
  Specified by:
    `findProcessInstance` in interface `AuditService`
  Parameters:
    `processInstanceId` - unique identifier of process instance
  Returns:
    process instance log for given process instance id or null if not found

### findSubProcessInstances

    public List<ProcessInstanceLog> findSubProcessInstances(long processInstanceId)

  Description copied from interface: `AuditService`
  Returns all known subprocess instance logs for given process instance id - considered parent process instance id

  Specified by:
    `findSubProcessInstances` in interface `AuditLogService`
  Specified by:
    `findSubProcessInstances` in interface `AuditService`
  Parameters:
    `processInstanceId` - identifier of the parent process instance id
  Returns:
    all process instance logs that are subprocess to a given process instance id

### findNodeInstances

    public List<NodeInstanceLog> findNodeInstances(long processInstanceId)

  Description copied from interface: `AuditService`
  Returns all node instances that were already triggered for given process instance id

  Specified by:
    `findNodeInstances` in interface `AuditLogService`
  Specified by:
    `findNodeInstances` in interface `AuditService`
  Parameters:
    `processInstanceId` - unique identifier of process instance
  Returns:
    all node instance logs for given process instance id

### findNodeInstances

    public List<NodeInstanceLog> findNodeInstances(long processInstanceId,
                                                   String nodeId)

  Description copied from interface: `AuditService`
  Returns all node instances that were already triggered for given process instance id and node identifier

  Specified by:
    `findNodeInstances` in interface `AuditLogService`
  Specified by:
    `findNodeInstances` in interface `AuditService`
  Parameters:
    `processInstanceId` - unique identifier of process instance
    `nodeId` - node identifier - by default it should be unique id (from process definition) but if not available regular node id shall be used
  Returns:

### findVariableInstances

    public List<VariableInstanceLog> findVariableInstances(long processInstanceId)

  Description copied from interface: `AuditService`
  Returns all variable logs for given process instance id

  Specified by:
    `findVariableInstances` in interface `AuditLogService`
  Specified by:
    `findVariableInstances` in interface `AuditService`
  Parameters:
    `processInstanceId` - unique identifier of process instance
  Returns:
    all variables logs for given process instance or empty list of none were found

### findVariableInstances

    public List<VariableInstanceLog> findVariableInstances(long processInstanceId,
                                                           String variableId)

  Description copied from interface: `AuditService`
  Returns all variable logs for given process instance id and variable identifier

  Specified by:
    `findVariableInstances` in interface `AuditLogService`
  Specified by:
    `findVariableInstances` in interface `AuditService`
  Parameters:
    `processInstanceId` - unique identifier of process instance
    `variableId` - variable name
  Returns:
    all variable logs for given process instance and variable identifier or empty list if none were found

### findVariableInstancesByName

    public List<VariableInstanceLog> findVariableInstancesByName(String variableId,
                                                                 boolean onlyActiveProcesses)

  Description copied from interface: `AuditService`
  Returns all variable logs that are identified by variable id regardless of what process instance they belong to

  Specified by:
    `findVariableInstancesByName` in interface `AuditLogService`
  Specified by:
    `findVariableInstancesByName` in interface `AuditService`
  Parameters:
    `variableId` - variable name
    `onlyActiveProcesses` - indicates if only active process instances should be considered or both active and completed
  Returns:
    all variable logs for given variable id or empty list if none were found

### findVariableInstancesByNameAndValue

    public List<VariableInstanceLog> findVariableInstancesByNameAndValue(String variableId,
                                                                         String value,
                                                                         boolean onlyActiveProcesses)

  Description copied from interface: `AuditService`
  Returns all variable logs that are identified by variable id and has given value regardless of what process instance they belong to

  Specified by:
    `findVariableInstancesByNameAndValue` in interface `AuditLogService`
  Specified by:
    `findVariableInstancesByNameAndValue` in interface `AuditService`
  Parameters:
    `variableId` - variable name
    `value` - value of the variable
    `onlyActiveProcesses` - indicates if only active process instances should be considered or both active and completed
  Returns:
    all variable logs for given variable id and its value matches given value or empty list if none were found

### clear

    public void clear()

  Description copied from interface: `AuditService`
  Removes all entries from audit data store

  Specified by:
    `clear` in interface `AuditService`

### dispose

    public void dispose()

  Description copied from interface: `AuditService`
  Indicates that work with this instance of `AuditService` is completed and can be disposed (release resources)

  Specified by:
    `dispose` in interface `AuditService`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| jBPM distribution 6.2.0.Beta1
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2001-2014 JBoss by Red Hat. All Rights Reserved.