Interface IWorkflowSession
- All Superinterfaces:
IAttributeStore<Object>, ISession, IUserToken
- 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 Summary
Modifier and TypeMethodDescriptioncreateTaskAndCase(IProcessStart processStart) Starts a new task and creates a case for a process.static IWorkflowSessioncurrent()Gets the current workflow session.findStartable(String id) Returns an optional startable for the given id that the current user can start.findWorkingTask(long taskIdentifier) Finds a task the current session user is working on (task stateTaskState.RESUMEDorTaskState.CREATED) with its identifier.Returns all startables which the current user can start.Returns all process start elements which the current user can start.Returns all startables which the current user can start and which are set visible in the start list.Gets the workflow contextvoidParks/reserves a running task for the current session user.voidResets a task the workflow session user is working on.resumeTask(long taskIdentifier) Resumes a suspended or parked task with its identifier.Methods inherited from interface IAttributeStore
getAttribute, getAttributeNames, removeAttribute, setAttributeMethods inherited from interface ISession
assignRole, checkPassword, checkPermission, getActiveSubstitutions, getClusterNode, getContentLocale, getFormattingLocale, getIdentifier, getMySessions, getSecurityContext, getSessionUser, getSessionUserName, hasActiveSubstitutions, hasMoreThanOneSession, hasPermission, isAbsent, isMemberThroughActiveSubstitution, isMemberThroughActiveSubstitution, isSessionUserSystemUser, isSessionUserUnknown, loginSessionUser, loginSessionUser, logoutSessionUser, logoutSessionUser, setContentLocale, setContentLocale, setFormattingLocale, setFormattingLocaleMethods inherited from interface IUserToken
canActAsUser, has, hasRole, hasRole
-
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
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
Finds a task the current session user is working on (task stateTaskState.RESUMEDorTaskState.CREATED) with its identifier. Returns null if task does not exists or is not in stateTaskState.RESUMEDorTaskState.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
Starts a new task and creates a case for a process. The returned task is in stateTaskState.CREATEDand 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
Resumes a suspended or parked task with its identifier.
Returns null if:
- the task does not exists
- is not in state
TaskState.SUSPENDEDorTaskState.PARKED - the session user is not allowed to resume this task
A session user is allowed to resume a task if he is member of the task responsibles and the task is in state
TaskState.SUSPENDEDor he is the task worker user and the task is in stateTaskState.PARKED.- Parameters:
taskIdentifier- ITask identifier- Returns:
- ITask or null.
- Throws:
PersistencyException- if persistency access fails- See Also:
- API:
- This public API is available in Java.
- Security:
- SESSION IS SYSTEM
-
resetTask
Resets a task the workflow session user is working on.
A task that is in state
TaskState.CREATEDis deleted afterwardsA task that is in state
TaskState.RESUMEDorTaskState.PARKEDis in stateTaskState.SUSPENDEDafterwards.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
Parks/reserves a running task for the current session user.
Task must be in state
TaskState.CREATED,TaskState.RESUMEDorTaskState.SUSPENDEDThe session user of this session must be known (
ISession.getSessionUser()!= null)Task is in state
TaskState.PARKEDafterwards.- 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
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.
-