Class BonitaWork

  • Direct Known Subclasses:
    TenantAwareBonitaWork

    public abstract class BonitaWork
    extends java.lang.Object
    Author:
    Baptiste Mesta
    • Field Detail

      • tenantId

        protected long tenantId
    • Constructor Detail

      • BonitaWork

        public BonitaWork()
    • Method Detail

      • getUuid

        public java.lang.String getUuid()
      • getDescription

        public abstract java.lang.String getDescription()
      • getRecoveryProcedure

        public java.lang.String getRecoveryProcedure()
        Returns:
        how to restart the work if it fails
      • work

        public abstract java.util.concurrent.CompletableFuture<java.lang.Void> work​(java.util.Map<java.lang.String,​java.lang.Object> context)
                                                                             throws java.lang.Exception
        Execution code of the work
        Parameters:
        context - a map of context that can be filled by a work to be given to a wrapped work
        Throws:
        java.lang.Exception
      • handleFailure

        public abstract void handleFailure​(java.lang.Throwable e,
                                           java.util.Map<java.lang.String,​java.lang.Object> context)
                                    throws java.lang.Exception
        Throws:
        java.lang.Exception
      • canBeRecoveredByTheRecoveryMechanism

        public boolean canBeRecoveredByTheRecoveryMechanism()
        Returns:
        true if the RecoveryService can recover this kind of failure
      • getTenantId

        public long getTenantId()
      • setTenantId

        public void setTenantId​(long tenantId)
      • setParent

        public void setParent​(BonitaWork parentWork)
      • getRootWork

        protected BonitaWork getRootWork()
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object