Interface DatabaseDialect

    • Method Detail

      • resumeBrokenBusinessProcesses

        void resumeBrokenBusinessProcesses​(java.sql.Connection con)
                                    throws java.lang.Exception
        Throws:
        java.lang.Exception
      • dequeue

        java.util.List<Workflow<?>> dequeue​(java.lang.String ppoolId,
                                            int max,
                                            java.sql.Connection con)
                                     throws java.lang.Exception
        Throws:
        java.lang.Exception
      • updateQueueState

        int updateQueueState​(int max,
                             java.sql.Connection con)
                      throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • deleteStaleResponse

        int deleteStaleResponse​(java.sql.Connection con,
                                int maxRows)
                         throws java.lang.Exception
        Throws:
        java.lang.Exception
      • restart

        void restart​(java.lang.String workflowInstanceId,
                     java.sql.Connection c)
              throws java.lang.Exception
        Throws:
        java.lang.Exception
      • restartFiltered

        void restartFiltered​(org.copperengine.management.model.WorkflowInstanceFilter filter,
                             java.sql.Connection con)
                      throws java.lang.Exception
        Throws:
        java.lang.Exception
      • restartAll

        void restartAll​(java.sql.Connection c)
                 throws java.lang.Exception
        Throws:
        java.lang.Exception
      • deleteBroken

        void deleteBroken​(java.lang.String workflowInstanceId,
                          java.sql.Connection c)
                   throws java.lang.Exception
        Throws:
        java.lang.Exception
      • deleteWaiting

        void deleteWaiting​(java.lang.String workflowInstanceId,
                           java.sql.Connection c)
                    throws java.lang.Exception
        Throws:
        java.lang.Exception
      • deleteFiltered

        void deleteFiltered​(org.copperengine.management.model.WorkflowInstanceFilter filter,
                            java.sql.Connection con)
                     throws java.lang.Exception
        Throws:
        java.lang.Exception
      • notify

        void notify​(java.util.List<Response<?>> responses,
                    java.sql.Connection c)
             throws java.lang.Exception
        Throws:
        java.lang.Exception
      • createBatchCommand4Notify

        BatchCommand createBatchCommand4Notify​(Response<?> response,
                                               Acknowledge callback)
                                        throws java.lang.Exception
        Throws:
        java.lang.Exception
      • setRemoveWhenFinished

        void setRemoveWhenFinished​(boolean removeWhenFinished)
        Parameters:
        removeWhenFinished - If true (default), finished workflow instances are removed from the database.
      • checkDbConsistency

        java.util.List<java.lang.String> checkDbConsistency​(java.sql.Connection con)
                                                     throws java.lang.Exception
        Checks the DB consistency, e.g. at system startup, by deserialising all workflow instances in the underlying database.
        Parameters:
        con - database connection
        Returns:
        list of ids of bad workflows which could not be deserialized
        Throws:
        java.lang.Exception - For any SQL error like losing connection or such.
      • startup

        void startup()
      • shutdown

        void shutdown()
      • read

        Workflow<?> read​(java.lang.String workflowInstanceId,
                         java.sql.Connection con)
                  throws java.lang.Exception
        Throws:
        java.lang.Exception
      • queryAllActive

        java.util.List<Workflow<?>> queryAllActive​(java.lang.String className,
                                                   java.sql.Connection con,
                                                   int max)
                                            throws java.sql.SQLException
        Query workflows that were active at the moment in (ENQUEUE, RUNNING or WAITING) state
        Parameters:
        className - - optional, specify which className it want to return. May be null. (No filtering for class name done in this case) If specified, the className must fully match the class name, so no regexp or similar is allowed. className must be given as fully qualified name (i.e. with package names prepending). Example is org.copperengine.examples.workflows.MyWorkflow
        con - - database connection
        max - maximum number to be queried (Translates to LIMIT max or FETCH ,max or similar on SQL queries SELECT)
        Returns:
        List of active workflows.
        Throws:
        java.sql.SQLException - If anything goes wrong regarding SQL.
      • readDatabaseClock

        java.util.Date readDatabaseClock​(java.sql.Connection con)
                                  throws java.sql.SQLException
        Read the current system time from the underlying database system
        Parameters:
        con - database connection
        Returns:
        Current database clock time
        Throws:
        java.sql.SQLException - Any sql error happening in here.
      • queryQueueSize

        int queryQueueSize​(java.lang.String processorPoolId,
                           int max,
                           java.sql.Connection con)
                    throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • queryObjectState

        java.lang.String queryObjectState​(java.lang.String id,
                                          java.sql.Connection con)
                                   throws java.lang.Exception
        Throws:
        java.lang.Exception
      • queryWorkflowInstances

        java.util.List<Workflow<?>> queryWorkflowInstances​(org.copperengine.management.model.WorkflowInstanceFilter filter,
                                                           java.sql.Connection con)
                                                    throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • countWorkflowInstances

        int countWorkflowInstances​(org.copperengine.management.model.WorkflowInstanceFilter filter,
                                   java.sql.Connection con)
                            throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • queryAuditTrailInstances

        java.util.List<org.copperengine.management.model.AuditTrailInfo> queryAuditTrailInstances​(org.copperengine.management.model.AuditTrailInstanceFilter filter,
                                                                                                  java.sql.Connection con)
                                                                                           throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • queryAuditTrailMessage

        java.lang.String queryAuditTrailMessage​(long id,
                                                java.sql.Connection con)
                                         throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • countAuditTrailInstances

        int countAuditTrailInstances​(org.copperengine.management.model.AuditTrailInstanceFilter filter,
                                     java.sql.Connection con)
                              throws java.sql.SQLException
        Throws:
        java.sql.SQLException