Interface IWorkflowSession

All Superinterfaces:
IAttributeStore<Object>, ISession, IUserToken

public interface IWorkflowSession extends ISession
A workflow session extends a security session with workflow functionality. Gives access to all workflow objects (task and cases) that belongs to the user of this session. A workflow object belongs to a user if:
  • A task is assigned to him or a role he owns.
  • A task he is currently working on.
  • A task he worked on in the past (needs permission).
  • A task that a member of a role he owns has worked on in the past (needs permission).
  • A case he has started (needs permission).
  • A case that have been started by a member of a role he owns (needs permission),
  • A case that has a task which he worked on (needs permission).
  • A case that has a task which a member of a role he owns has worked on in the past (needs permission).
Since:
17.05.2006
API:
This is a public API.
  • Method Details

    • getWorkflowContext

      IWorkflowContext getWorkflowContext()
      Gets the workflow context
      Returns:
      workflow context
      API:
      This public API is available in Java.
    • getStartableProcessStarts

      List<IProcessStart> getStartableProcessStarts()
      Returns all process start elements which the current user can start.
      Returns:
      process starts
      Throws:
      PersistencyException - if persistency access fails
      API:
      This public API is available in Java.
    • getStartables

      List<IWebStartable> getStartables()
      Returns all startables which the current user can start and which are set visible in the start list.
      Returns:
      startables
      Since:
      6.6.2
      API:
      This public API is available in Java.
    • getAllStartables

      Stream<IWebStartable> getAllStartables()
      Returns all startables which the current user can start.
      Returns:
      startables
      Since:
      10.0.6
      API:
      This public API is available in Java.
    • findStartable

      Optional<IWebStartable> findStartable(String id)
      Returns an optional startable for the given id that the current user can start.
      Parameters:
      id - in the form of {appName}/{processModelName}/{processName}/{startSignature}.ivp, e.g. app1/demoProject/myProcess/start123.ivp
      Returns:
      startable
      Since:
      11.3.0
      See Also:
      API:
      This public API is available in Java.
    • findWorkingTask

      ITask findWorkingTask(long taskIdentifier)
      Finds a task the current session user is working on (task state TaskState.RESUMED or TaskState.CREATED) with its identifier. Returns null if task does not exists or is not in state TaskState.RESUMED or TaskState.CREATED.
      Parameters:
      taskIdentifier - ITask identifier
      Returns:
      ITask or null
      Throws:
      PersistencyException - if persistency access fails
      API:
      This public API is available in Java.
      Security:
      SESSION MATCHES THIS AND OWNS TaskReadAllOwnWorking PERMISSION
    • createTaskAndCase

      ITask createTaskAndCase(IProcessStart processStart)
      Starts a new task and creates a case for a process. The returned task is in state TaskState.CREATED and the workerUser is set to the current user. This method can be used to create a non persistent case and task that is started by the calling user right now.
      Parameters:
      processStart - process start from which the created case and task starts
      Returns:
      new created task
      Throws:
      PersistencyException - If persistency access fails
      API:
      This public API is available in Java.
      Security:
      SESSION IS SYSTEM
    • resumeTask

      ITask resumeTask(long taskIdentifier)

      Resumes a suspended or parked task with its identifier.

      Returns null if:

      A session user is allowed to resume a task if he is member of the task responsibles and the task is in state TaskState.SUSPENDED or he is the task worker user and the task is in state TaskState.PARKED.

      Parameters:
      taskIdentifier - ITask identifier
      Returns:
      ITask or null.
      Throws:
      PersistencyException - if persistency access fails
      See Also:
      • resumeTask(long, String)
      API:
      This public API is available in Java.
      Security:
      SESSION IS SYSTEM
    • resetTask

      void resetTask(ITask runningTask)

      Resets a task the workflow session user is working on.

      A task that is in state TaskState.CREATED is deleted afterwards

      A task that is in state TaskState.RESUMED or TaskState.PARKED is in state TaskState.SUSPENDED afterwards.

      If the task is not in one of the above state users must not call this method.

      Parameters:
      runningTask - The running task to rollback
      Throws:
      PersistencyException - if rollback fails
      API:
      This public API is available in Java.
      Security:
      SESSION MATCHES THIS AND OWNS TaskResetOwnWorkingTask PERMISSION
    • parkTask

      void parkTask(ITask task)

      Parks/reserves a running task for the current session user.

      Task must be in state TaskState.CREATED, TaskState.RESUMED or TaskState.SUSPENDED

      The session user of this session must be known (ISession.getSessionUser() != null)

      Task is in state TaskState.PARKED afterwards.

      Parameters:
      task - The task to park
      Throws:
      PersistencyException - if persistency access fails
      API:
      This public API is available in Java.
      Security:
      SESSION MATCHES THIS AND OWNS TaskParkOwnWorkingTask PERMISSION
    • current

      static IWorkflowSession current()

      Gets the current workflow session.

      Will return null if called out of scope. The scope is set if you call this method from an ivy process or any supported ivy environment. It is not set in non supported ivy environments (e.g. if you start your own threads, etc.).

      Returns:
      current workflow session or null if out of scope
      Since:
      9.1
      API:
      This public API is available in Java.