Class WorkflowIdentity

java.lang.Object
com.axelor.workflow.security.WorkflowIdentity

public class WorkflowIdentity extends Object
Restores workflow user attribution on scheduler and capture-dispatch threads. Sets Axelor's current user for audit columns and expressions; establishes no Shiro subject.
  • Constructor Details

    • WorkflowIdentity

      public WorkflowIdentity()
  • Method Details

    • as

      public <T> T as(Long runId, Supplier<T> work)
      Runs as the initiator, restoring the thread's identity even on failure. Deleted or inactive initiators leave the work unattributed: already-owed work must still complete.
    • asUser

      public <T> T asUser(User subject, Supplier<T> work)
      Establish a captured identity without inheriting the dispatcher's ambient user.
    • asUser

      public void asUser(User subject, Runnable work)
    • as

      public void as(Long runId, Runnable work)
      The same, for work that answers nothing.