org.apache.ode.dao.jpa

## Class ProcessDAOImpl

- java.lang.Object
- - org.apache.ode.dao.jpa.OpenJPADAO
  - - org.apache.ode.dao.jpa.ProcessDAOImpl

- All Implemented Interfaces:
    ProcessDAO

      public class ProcessDAOImpl
      extends OpenJPADAO
      implements ProcessDAO

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ProcessDAOImpl()`
    `ProcessDAOImpl(javax.xml.namespace.QName pid, javax.xml.namespace.QName type, java.lang.String guid, long version)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `CorrelatorDAO` | `addCorrelator(java.lang.String correlator)`
    `ProcessInstanceDAO` | `createInstance(CorrelatorDAO instantiatingCorrelator)` Create a new process instance object.
    `ProcessInstanceDAO` | `createInstance(CorrelatorDAO instantiatingCorrelator, MessageExchangeDAO mex)`
    `void` | `deleteProcessAndRoutes()` Deletes only the process and routes without instances.
    `java.util.Collection<ProcessInstanceDAO>` | `findInstance(CorrelationKey ckey)` Locates a process instance based on a correlation key.
    `java.util.Collection<ProcessInstanceDAO>` | `findInstance(CorrelationKey ckey, short processInstanceState)` Find instances across all versions of a process that match the correlation key and instance state.
    `java.util.Collection<ProcessInstanceDAO>` | `getActiveInstances()`
    `CorrelatorDAO` | `getCorrelator(java.lang.String correlatorId)` Get a message correlator instance.
    `java.lang.String` | `getGuid()`
    `java.io.Serializable` | `getId()`
    `ProcessInstanceDAO` | `getInstance(java.lang.Long iid)` Get a process instance (by identifier).
    `int` | `getNumInstances()`
    `javax.xml.namespace.QName` | `getProcessId()` Get the unique process identifier.
    `javax.xml.namespace.QName` | `getType()` Get the BPEL process name.
    `long` | `getVersion()` Get the process version
    `void` | `instanceCompleted(ProcessInstanceDAO instance)` Callback indicating that a process instance has completed its duties.
    `void` | `removeRoutes(java.lang.String routeId, ProcessInstanceDAO target)` Remove the routes with the given Id for all the correlators in the process.
    `void` | `setId(java.lang.Long id)`

    - ### Methods inherited from class org.apache.ode.dao.jpa.OpenJPADAO

      `batchUpdateByIds, getConn, getEM, getSingleResult`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ProcessDAOImpl

          public ProcessDAOImpl()

    - #### ProcessDAOImpl

          public ProcessDAOImpl(javax.xml.namespace.QName pid,
                        javax.xml.namespace.QName type,
                        java.lang.String guid,
                        long version)

  - ### Method Detail

    - #### getId

          public java.io.Serializable getId()

    - #### setId

          public void setId(java.lang.Long id)

    - #### addCorrelator

          public CorrelatorDAO addCorrelator(java.lang.String correlator)

      Specified by:
        `addCorrelator` in interface `ProcessDAO`

    - #### getCorrelator

          public CorrelatorDAO getCorrelator(java.lang.String correlatorId)

      Description copied from interface: `ProcessDAO`
      Get a message correlator instance.
      Specified by:
        `getCorrelator` in interface `ProcessDAO`
      Parameters:
        `correlatorId` - correlator identifier
      Returns:
        correlator corresponding to the given identifier

    - #### createInstance

          public ProcessInstanceDAO createInstance(CorrelatorDAO instantiatingCorrelator)

      Description copied from interface: `ProcessDAO`
      Create a new process instance object.
      Specified by:
        `createInstance` in interface `ProcessDAO`
      Parameters:
        `instantiatingCorrelator` - instantiating `CorrelatorDAO`
      Returns:
        newly generated instance DAO

    - #### createInstance

          public ProcessInstanceDAO createInstance(CorrelatorDAO instantiatingCorrelator,
                                          MessageExchangeDAO mex)

    - #### findInstance

          public java.util.Collection<ProcessInstanceDAO> findInstance(CorrelationKey ckey)

      Description copied from interface: `ProcessDAO`
      Locates a process instance based on a correlation key.
      Specified by:
        `findInstance` in interface `ProcessDAO`
      Parameters:
        `ckey` - correlation key
      Returns:
        collection of `ProcessInstanceDAO` that match correlation key, ordered by date

    - #### getInstance

          public ProcessInstanceDAO getInstance(java.lang.Long iid)

      Description copied from interface: `ProcessDAO`
      Get a process instance (by identifier).
      Specified by:
        `getInstance` in interface `ProcessDAO`
      Parameters:
        `iid` - unique instance identifier.
      Returns:
        DAO corresponding to the process instance

    - #### getProcessId

          public javax.xml.namespace.QName getProcessId()

      Description copied from interface: `ProcessDAO`
      Get the unique process identifier.
      Specified by:
        `getProcessId` in interface `ProcessDAO`
      Returns:
        process identifier

    - #### getType

          public javax.xml.namespace.QName getType()

      Description copied from interface: `ProcessDAO`
      Get the BPEL process name.
      Specified by:
        `getType` in interface `ProcessDAO`
      Returns:
        qualified BPEL process name.

    - #### deleteProcessAndRoutes

          public void deleteProcessAndRoutes()

      Description copied from interface: `ProcessDAO`
      Deletes only the process and routes without instances. This also deletes any static data to the process: correlators.
      Specified by:
        `deleteProcessAndRoutes` in interface `ProcessDAO`

    - #### getNumInstances

          public int getNumInstances()

      Specified by:
        `getNumInstances` in interface `ProcessDAO`

    - #### getVersion

          public long getVersion()

      Description copied from interface: `ProcessDAO`
      Get the process version
      Specified by:
        `getVersion` in interface `ProcessDAO`
      Returns:
        version

    - #### instanceCompleted

          public void instanceCompleted(ProcessInstanceDAO instance)

      Description copied from interface: `ProcessDAO`
      Callback indicating that a process instance has completed its duties.
      Specified by:
        `instanceCompleted` in interface `ProcessDAO`
      Parameters:
        `instance` - the completed `ProcessInstanceDAO`

    - #### removeRoutes

          public void removeRoutes(java.lang.String routeId,
                          ProcessInstanceDAO target)

      Description copied from interface: `ProcessDAO`
      Remove the routes with the given Id for all the correlators in the process.
      Specified by:
        `removeRoutes` in interface `ProcessDAO`

    - #### getGuid

          public java.lang.String getGuid()

      Specified by:
        `getGuid` in interface `ProcessDAO`

    - #### getActiveInstances

          public java.util.Collection<ProcessInstanceDAO> getActiveInstances()

      Specified by:
        `getActiveInstances` in interface `ProcessDAO`
      Returns:
        all instances that haven't completed, use with care as there could be a lot of them

    - #### findInstance

          public java.util.Collection<ProcessInstanceDAO> findInstance(CorrelationKey ckey,
                                                              short processInstanceState)

      Find instances across all versions of a process that match the correlation key and instance state.
      Specified by:
        `findInstance` in interface `ProcessDAO`
      Parameters:
        `ckey` - Correlation key
        `processInstanceState` - Instance state org.apache.ode.bpel.common.ProcessState
      Returns:
        collection of `ProcessInstanceDAO` that match correlation key, instance state