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.findCreatedAndResumedWorkTasks(int startIndex, int count) Deprecated, for removal: This API element is subject to removal in a future version.findInvolvedCases(IPropertyFilter<CaseProperty> filter, List<PropertyOrder<CaseProperty>> order, int startIndex, int count, boolean returnAllCount) Deprecated, for removal: This API element is subject to removal in a future version.useCaseQueryDeprecated, for removal: This API element is subject to removal in a future version.useCaseQueryfindInvolvedCasesByRole(List<IRole> roles, IPropertyFilter<CaseProperty> filter, List<PropertyOrder<CaseProperty>> order, int startIndex, int count, boolean returnAllCount) Deprecated, for removal: This API element is subject to removal in a future version.useCaseQueryfindInvolvedCasesByRoleCategories(List<IRole> roles, IPropertyFilter<CaseProperty> categoryFilter, CaseProperty categoryProperty, OrderDirection categoryPropertyOrder) Deprecated, for removal: This API element is subject to removal in a future version.useCategoryTree.createFor(CaseQuery)insteadfindInvolvedCasesCategories(IPropertyFilter<CaseProperty> categoryFilter, CaseProperty categoryProperty, OrderDirection categoryPropertyOrder) Deprecated, for removal: This API element is subject to removal in a future version.useCategoryTree.createFor(CaseQuery)insteadfindLockedWorkTasks(IPropertyFilter<TaskProperty> filter, List<PropertyOrder<TaskProperty>> order, int startIndex, int count, boolean returnAllCount, EnumSet<TaskState> includeTaskStates) Deprecated, for removal: This API element is subject to removal in a future version.useTaskQueryfindParkedWorkTasks(int startIndex, int count) Deprecated, for removal: This API element is subject to removal in a future version.useTaskQueryfindResumedWorkTasks(int startIndex, int count) Deprecated, for removal: This API element is subject to removal in a future version.useTaskQueryfindStartable(String id) Returns an optional startable for the given id that the current user can start.findStartedCaseCategories(IPropertyFilter<CaseProperty> categoryFilter, CaseProperty categoryProperty, OrderDirection categoryPropertyOrder) Deprecated, for removal: This API element is subject to removal in a future version.useCategoryTree.createFor(CaseQuery)insteadfindStartedCases(int startIndex, int count, Date caseStartTimestampFilter) Deprecated, for removal: This API element is subject to removal in a future version.useCaseQueryfindStartedCases(IPropertyFilter<CaseProperty> filter, List<PropertyOrder<CaseProperty>> order, int startIndex, int count, boolean returnAllCount) Deprecated, for removal: This API element is subject to removal in a future version.useCaseQueryfindStartedCasesByRole(List<IRole> roles, IPropertyFilter<CaseProperty> filter, List<PropertyOrder<CaseProperty>> order, int startIndex, int count, boolean returnAllCount) Deprecated, for removal: This API element is subject to removal in a future version.useCaseQueryfindSuspendedAndParkedWorkTasks(int startIndex, int count) Deprecated, for removal: This API element is subject to removal in a future version.useTaskQueryfindSuspendedWorkTasks(int startIndex, int count) Deprecated, for removal: This API element is subject to removal in a future version.useTaskQueryfindWorkedOnTaskCategories(IPropertyFilter<TaskProperty> categoryFilter, TaskProperty categoryProperty, OrderDirection categoryPropertyOrder) Deprecated, for removal: This API element is subject to removal in a future version.useCategoryTree.createFor(TaskQuery)insteadfindWorkedOnTasks(int startIndex, int count, Date taskEndTimestampFilter) Deprecated, for removal: This API element is subject to removal in a future version.useTaskQueryfindWorkedOnTasks(IPropertyFilter<TaskProperty> filter, List<PropertyOrder<TaskProperty>> order, int startIndex, int count, boolean returnAllCount) Deprecated, for removal: This API element is subject to removal in a future version.useTaskQueryfindWorkedOnTasksByRole(List<IRole> roles, IPropertyFilter<TaskProperty> filter, List<PropertyOrder<TaskProperty>> order, int startIndex, int count, boolean returnAllCount) Deprecated, for removal: This API element is subject to removal in a future version.useTaskQueryfindWorkingTask(long taskIdentifier) Finds a task the current session user is working on (task stateTaskState.RESUMEDorTaskState.CREATED) with its identifier.findWorkTaskCategories(IPropertyFilter<TaskProperty> categoryFilter, TaskProperty categoryProperty, OrderDirection categoryPropertyOrder, EnumSet<TaskState> includeTaskStates) Deprecated, for removal: This API element is subject to removal in a future version.useCategoryTree.createFor(TaskQuery)insteadfindWorkTasks(IPropertyFilter<TaskProperty> filter, List<PropertyOrder<TaskProperty>> order, int startIndex, int count, boolean returnAllCount, EnumSet<TaskState> includeTaskStates) Deprecated, for removal: This API element is subject to removal in a future version.useTaskQueryReturns 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 ch.ivyteam.util.IAttributeStore
getAttribute, getAttributeNames, removeAttribute, setAttributeMethods inherited from interface ch.ivyteam.ivy.security.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 ch.ivyteam.ivy.security.IUserToken
canActAsUser, has, 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
-
findWorkTasks
@Deprecated(since="12.0.0", forRemoval=true) IQueryResult<ITask> findWorkTasks(IPropertyFilter<TaskProperty> filter, List<PropertyOrder<TaskProperty>> order, int startIndex, int count, boolean returnAllCount, EnumSet<TaskState> includeTaskStates) Deprecated, for removal: This API element is subject to removal in a future version.useTaskQueryGets all tasks the workflow session user can work on.
If includeTaskStates contains state
TaskState.SUSPENDEDall tasks in stateTaskState.SUSPENDEDthat the workflow session user can resume are also included in the result.If includeTaskStates contains state
TaskState.CREATEDall tasks in stateTaskState.CREATEDthat the workflow session user are working on are also included in the result.If includeTaskStates contains state
TaskState.RESUMEDall tasks in stateTaskState.RESUMEDthat the workflow session user are working on are also included in the result.If includeTaskStates contains state
TaskState.PARKEDall tasks in stateTaskState.PARKEDthat the workflow session user can resume are also included in the result.Consider to use the
TaskQueryAPI alternatively. This fluent API makes the statement combinable with other filters and allows SQL-like value comparisons. E.g:TaskQuery query = TaskQuery.create() .where().currentUserCanWorkOn(); List<ITask> tasks = ivy.wf.getTaskQueryExecutor().getResults(query, startIndex, count);
- Parameters:
filter- filter criteria to specify which tasks should be readorder- how to order the resultstartIndex- the index of the first task of all tasks found returnedcount- how many tasks found are returned. -1 for all.returnAllCount- if true the query result methodIQueryResult.getAllCount()returns the overall cases that have been found, if false it returns -1includeTaskStates- set of task states that should be included.- Returns:
- query result with the found tasks
- Throws:
PersistencyException- if persistency access fails.- See Also:
- API:
- This public API is available in Java.
- Security:
- SESSION MATCHES THIS AND OWNS TaskReadAllOwnWork PERMISSION
-
findSuspendedWorkTasks
@Deprecated(since="12.0.0", forRemoval=true) List<ITask> findSuspendedWorkTasks(int startIndex, int count) Deprecated, for removal: This API element is subject to removal in a future version.useTaskQueryGets all tasks the workflow session user can work on that are in stateTaskState.SUSPENDED. This is a user convenience method. The method calls internal the methodfindWorkTasks(IPropertyFilter, List, int, int, boolean, EnumSet). The tasks are not filtered. They are sorted as follows priority ascending (higher priority first), start timestamp ascending (older first), id ascending. If you want to filter or order your result you should use directly the methodfindWorkTasks(IPropertyFilter, List, int, int, boolean, EnumSet).Consider to use the
TaskQueryAPI alternatively. This fluent API makes the statement combinable with other filters and allows SQL-like value comparisons. E.g:TaskQuery query = TaskQuery.create() .where().currentUserCanWorkOn() .and().state().isEqual(TaskState.SUSPENDED); List<ITask> tasks = ivy.wf.getTaskQueryExecutor().getResults(query, startIndex, count);
- Parameters:
startIndex- the index of the first task of all tasks found that will be returnedcount- how many tasks should be returned. -1 for all.- Returns:
- list with the found tasks
- Throws:
PersistencyException- if persistency access fails.- See Also:
- API:
- This public API is available in Java.
- Security:
- SESSION MATCHES THIS AND OWNS TaskReadAllOwnWork PERMISSION
-
findSuspendedAndParkedWorkTasks
@Deprecated(since="12.0.0", forRemoval=true) List<ITask> findSuspendedAndParkedWorkTasks(int startIndex, int count) Deprecated, for removal: This API element is subject to removal in a future version.useTaskQueryGets all tasks the workflow session user can work on that are in stateTaskState.SUSPENDEDorTaskState.PARKED. This is a user convenience method. The method calls internal the methodfindWorkTasks(IPropertyFilter, List, int, int, boolean, EnumSet). The tasks are not filtered. They are sorted as follows priority ascending (higher priority first), start timestamp ascending (older first), id ascending. If you want to filter or order your result you should use directly the methodfindWorkTasks(IPropertyFilter, List, int, int, boolean, EnumSet).Consider to use the
TaskQueryAPI alternatively. This fluent API makes the statement combinable with other filters and allows SQL-like value comparisons. E.g:TaskQuery query = TaskQuery.create() .where().currentUserCanWorkOn() .and( TaskQuery.create() .where().state().isEqual(TaskState.SUSPENDED) .or().state().isEqual(TaskState.PARKED) ); List<ITask> tasks = ivy.wf.getTaskQueryExecutor().getResults(query, startIndex, count);
- Parameters:
startIndex- the index of the first task of all tasks found that will be returnedcount- how many tasks should be returned. -1 for all.- Returns:
- list with the found tasks
- Throws:
PersistencyException- if persistency access fails.- See Also:
- API:
- This public API is available in Java.
- Security:
- SESSION MATCHES THIS AND OWNS TaskReadAllOwnWork PERMISSION
-
findParkedWorkTasks
@Deprecated(since="12.0.0", forRemoval=true) List<ITask> findParkedWorkTasks(int startIndex, int count) Deprecated, for removal: This API element is subject to removal in a future version.useTaskQueryGets all tasks the workflow session user can work on that are in stateTaskState.PARKED. This is a user convenience method. The method calls internal the methodfindWorkTasks(IPropertyFilter, List, int, int, boolean, EnumSet). The tasks are not filtered. They are sorted as follows priority ascending (higher priority first), start timestamp ascending (older first), id ascending. If you want to filter or order your result you should use directly the methodfindWorkTasks(IPropertyFilter, List, int, int, boolean, EnumSet).Consider to use the
TaskQueryAPI alternatively. This fluent API makes the statement combinable with other filters and allows SQL-like value comparisons. E.g:TaskQuery query = TaskQuery.create() .where().currentUserCanWorkOn() .and().state().isEqual(TaskState.PARKED); List<ITask> tasks = ivy.wf.getTaskQueryExecutor().getResults(query, startIndex, count);
- Parameters:
startIndex- the index of the first task of all tasks found that will be returnedcount- how many tasks should be returned. -1 for all.- Returns:
- list with the found tasks
- Throws:
PersistencyException- if persistency access fails.- See Also:
- API:
- This public API is available in Java.
- Security:
- SESSION MATCHES THIS AND OWNS TaskReadAllOwnWork PERMISSION
-
findResumedWorkTasks
@Deprecated(since="12.0.0", forRemoval=true) List<ITask> findResumedWorkTasks(int startIndex, int count) Deprecated, for removal: This API element is subject to removal in a future version.useTaskQueryGets all tasks the workflow session user can work on that are in stateTaskState.RESUMED. This is a user convenience method. The method calls internal the methodfindWorkTasks(IPropertyFilter, List, int, int, boolean, EnumSet). The tasks are not filtered. They are sorted as follows priority ascending (higher priority first), start timestamp ascending (older first), id ascending. If you want to filter or order your result you should use directly the methodfindWorkTasks(IPropertyFilter, List, int, int, boolean, EnumSet).Consider to use the
TaskQueryAPI alternatively. This fluent API makes the statement combinable with other filters and allows SQL-like value comparisons. E.g:TaskQuery query = TaskQuery.create() .where().currentUserCanWorkOn() .and().state().isEqual(TaskState.RESUMED); List<ITask> tasks = ivy.wf.getTaskQueryExecutor().getResults(query, startIndex, count);
- Parameters:
startIndex- the index of the first task of all tasks found that will be returnedcount- how many tasks should be returned. -1 for all.- Returns:
- list with the found tasks
- Throws:
PersistencyException- if persistency access fails.- See Also:
- API:
- This public API is available in Java.
- Security:
- SESSION MATCHES THIS AND OWNS TaskReadAllOwnWork PERMISSION
-
findCreatedAndResumedWorkTasks
@Deprecated(since="12.0.0", forRemoval=true) List<ITask> findCreatedAndResumedWorkTasks(int startIndex, int count) Deprecated, for removal: This API element is subject to removal in a future version.useTaskQueryGets all tasks the workflow session user can work on that are in stateTaskState.RESUMEDorTaskState.CREATED. This is a user convenience method. The method calls internal the methodfindWorkTasks(IPropertyFilter, List, int, int, boolean, EnumSet). The tasks are not filtered. They are sorted as follows priority ascending (higher priority first), start timestamp ascending (older first), id ascending. If you want to filter or order your result you should use directly the methodfindWorkTasks(IPropertyFilter, List, int, int, boolean, EnumSet).Consider to use the
TaskQueryAPI alternatively. This fluent API makes the statement combinable with other filters and allows SQL-like value comparisons. E.g:TaskQuery query = TaskQuery.create() .where().currentUserCanWorkOn() .and( TaskQuery.create() .where().state().isEqual(TaskState.CREATED) .or().state().isEqual(TaskState.RESUMED) ) List<ITask> tasks = ivy.wf.getTaskQueryExecutor().getResults(query, startIndex, count);
- Parameters:
startIndex- the index of the first task of all tasks found that will be returnedcount- how many tasks should be returned. -1 for all.- Returns:
- list with the found tasks
- Throws:
PersistencyException- if persistency access fails.- See Also:
- API:
- This public API is available in Java.
- Security:
- SESSION MATCHES THIS AND OWNS TaskReadAllOwnWork PERMISSION
-
findLockedWorkTasks
@Deprecated(since="12.0.0", forRemoval=true) IQueryResult<ITask> findLockedWorkTasks(IPropertyFilter<TaskProperty> filter, List<PropertyOrder<TaskProperty>> order, int startIndex, int count, boolean returnAllCount, EnumSet<TaskState> includeTaskStates) Deprecated, for removal: This API element is subject to removal in a future version.useTaskQueryGets all tasks the workflow session user could work if they were in state
TaskState.SUSPENDEDbut are currently in stateTaskState.RESUMEDorTaskState.PARKEDbecause other users are working on them.If includeTaskStates contains state
TaskState.RESUMEDall tasks in stateTaskState.RESUMEDthat the workflow session user could resume are also included in the result.If includeTaskStates contains state
TaskState.PARKEDall tasks in stateTaskState.PARKEDthat the workflow session user could resume are also included in the result.- Parameters:
filter- filter criteria to specify which tasks should be readorder- how to order the resultstartIndex- the index of the first task of all tasks found returnedcount- how many tasks found are returned. -1 for all.returnAllCount- if true the query result methodIQueryResult.getAllCount()returns the overall cases that have been found, if false it returns -1includeTaskStates- set of task states that should be included.- Returns:
- query result with the found tasks
- Throws:
PersistencyException- if persistency access fails.- API:
- This public API is available in Java.
- Security:
- SESSION MATCHES THIS AND OWNS TaskReadAllOwnLocked PERMISSION
-
findStartedCases
@Deprecated(since="12.0.0", forRemoval=true) IQueryResult<ICase> findStartedCases(IPropertyFilter<CaseProperty> filter, List<PropertyOrder<CaseProperty>> order, int startIndex, int count, boolean returnAllCount) Deprecated, for removal: This API element is subject to removal in a future version.useCaseQueryFinds all cases that the session users has started.Consider to use the
CaseQueryAPI alternatively. This fluent API makes the statement combinable with other filters and allows SQL-like value comparisons. E.g:CaseQuery query = CaseQuery.create() .where().currentUserHasStarted(); List<ICase> cases = ivy.wf.getCaseQueryExecutor().getResults(query, startIndex, count);
- Parameters:
filter- filter criteria to specify which cases should be in the resultorder- how to order the resultstartIndex- the index of the first case of all cases found returnedcount- how many cases found are returned. -1 for all.returnAllCount- if true the query result methodIQueryResult.getAllCount()returns the overall cases that have been found, if false it returns -1- Returns:
- query result with the cases
- Throws:
PersistencyException- if persistency access fails- See Also:
- API:
- This public API is available in Java.
- Security:
- SESSION MATCHES THIS AND OWNS CaseReadAllOwnStarted PERMISSION
-
findStartedCases
@Deprecated(since="12.0.0", forRemoval=true) List<ICase> findStartedCases(int startIndex, int count, Date caseStartTimestampFilter) Deprecated, for removal: This API element is subject to removal in a future version.useCaseQueryFinds all cases that the session users has started. This is a user convenience method. The method calls internal the methodfindStartedCases(IPropertyFilter, List, int, int, boolean). The cases are only filtered by the case start timestamp. They are sorted as follows: start timestamp descending (younger first), id descending. If you want to filter or order your result you should use directly the methodfindStartedCases(IPropertyFilter, List, int, int, boolean).Consider to use the
CaseQueryAPI alternatively. This fluent API makes the statement combinable with other filters and allows SQL-like value comparisons. E.g:CaseQuery query = CaseQuery.create() .where().currentUserHasStarted() .and().startTimestamp().isLowerOrEqualThan(caseStartTimestampFilter); List<ICase> cases = ivy.wf.getCaseQueryExecutor().getResults(query, startIndex, count);
- Parameters:
startIndex- the index of the first case of all cases found that will be returnedcount- how many cases should be returned. -1 for all.caseStartTimestampFilter- case start timestamp filter. Can be null if filter should be deactivated. Cases returned have start timestamps that are equal or earlier- Returns:
- list with the cases
- Throws:
PersistencyException- if persistency access fails- See Also:
- API:
- This public API is available in Java.
- Security:
- SESSION MATCHES THIS AND OWNS CaseReadAllOwnStarted PERMISSION
-
findStartedCasesByRole
@Deprecated(since="12.0.0", forRemoval=true) IQueryResult<ICase> findStartedCasesByRole(List<IRole> roles, IPropertyFilter<CaseProperty> filter, List<PropertyOrder<CaseProperty>> order, int startIndex, int count, boolean returnAllCount) Deprecated, for removal: This API element is subject to removal in a future version.useCaseQueryGets all cases somebody has started who needs a role to start the case which the current session user also owns.- Parameters:
roles- the roles that one must had to start the casefilter- filter criteria to specify which cases should be in the resultorder- how to order the resultstartIndex- the index of the first case of all cases found returnedcount- how many cases found are returned. -1 for all.returnAllCount- if true the query result methodIQueryResult.getAllCount()returns the overall cases that have been found, if false it returns -1- Returns:
- query result with the cases
- Throws:
PersistencyException- if persistency access fails- API:
- This public API is available in Java.
- Security:
- SESSION MATCHES THIS AND OWNS CaseReadAllOwnRoleStarted PERMISSION
-
findWorkedOnTasks
@Deprecated(since="12.0.0", forRemoval=true) IQueryResult<ITask> findWorkedOnTasks(IPropertyFilter<TaskProperty> filter, List<PropertyOrder<TaskProperty>> order, int startIndex, int count, boolean returnAllCount) Deprecated, for removal: This API element is subject to removal in a future version.useTaskQueryFinds all tasks that the session user has ever worked onConsider to use the
TaskQueryAPI alternatively. This fluent API makes the statement combinable with other filters and allows SQL-like value comparisons. E.g:TaskQuery query = TaskQuery.create() .where().currentUserHasWorkedOn(); List<ITask> tasks = ivy.wf.getTaskQueryExecutor().getResults(query, startIndex, count);
- Parameters:
filter- filter criteria to specify which tasks should be in the resultorder- how to order the resultstartIndex- the index of the first task of all tasks found returnedcount- how many tasks found are returned. -1 for all.returnAllCount- if true the query result methodIQueryResult.getAllCount()returns the overall cases that have been found, if false it returns -1- Returns:
- query result with the tasks
- See Also:
- API:
- This public API is available in Java.
- Security:
- SESSION MATCHES THIS AND OWNS TaskReadAllOwnWorkedOn PERMISSION
-
findWorkedOnTasks
@Deprecated(since="12.0.0", forRemoval=true) List<ITask> findWorkedOnTasks(int startIndex, int count, Date taskEndTimestampFilter) Deprecated, for removal: This API element is subject to removal in a future version.useTaskQueryFinds all tasks that the session users has ever worked on. This is a user convenience method. The method calls internal the methodfindWorkedOnTasks(IPropertyFilter, List, int, int, boolean). The tasks are only filtered by the task end timestamp. They are sorted as follows: end timestamp descending (younger first), id descending. If you want to filter or order your result you should use directly the methodfindWorkedOnTasks(IPropertyFilter, List, int, int, boolean).Consider to use the
TaskQueryAPI alternatively. This fluent API makes the statement combinable with other filters and allows SQL-like value comparisons. E.g:TaskQuery query = TaskQuery.create() .where().currentUserHasWorkedOn() .and().endTimestamp().isLowerOrEqualThan(taskEndTimestampFilter); List<ITask> tasks = ivy.wf.getTaskQueryExecutor().getResults(query, startIndex, count);
- Parameters:
startIndex- the index of the first case of all cases found that will be returnedcount- how many cases should be returned. -1 for all.taskEndTimestampFilter- task end timestamp filter. Can be null if filter should be deactivated. Tasks returned have end timestamps that are equal or earlier- Returns:
- list with the tasks
- See Also:
- API:
- This public API is available in Java.
- Security:
- SESSION MATCHES THIS AND OWNS TaskReadAllOwnWorkedOn PERMISSION
-
findWorkedOnTasksByRole
@Deprecated(since="12.0.0", forRemoval=true) IQueryResult<ITask> findWorkedOnTasksByRole(List<IRole> roles, IPropertyFilter<TaskProperty> filter, List<PropertyOrder<TaskProperty>> order, int startIndex, int count, boolean returnAllCount) Deprecated, for removal: This API element is subject to removal in a future version.useTaskQueryReturns all tasks the session user has worked on or could have worked on as member of the given roles.Example:
import ch.ivyteam.ivy.security.IRole; import ch.ivyteam.ivy.workflow.PropertyOrder; import ch.ivyteam.ivy.workflow.TaskProperty; import ch.ivyteam.ivy.workflow.IPropertyFilter; import ch.ivyteam.ivy.persistence.OrderDirection; import ch.ivyteam.logicalexpression.RelationalOperator; List<IRole> roleList; roleList.add(ivy.session.getSecurityContext().findRole("RoleName")); IPropertyFilter<TaskProperty> filter = ivy.wf.createTaskPropertyFilter(TaskProperty.END_TIMESTAMP, RelationalOperator.EQUAL_OR_LARGER, new Date() - '10h0m'); List<PropertyOrder<TaskProperty>> order; order.add(new PropertyOrder<TaskProperty>(TaskProperty.PRIORITY, OrderDirection.DESCENDING)); ivy.session.findWorkedOnTasksByRole(roleList, filter, order, 0, -1, false);- Parameters:
roles- the roles that one must had to work on the casefilter- filter criteria to specify which tasks should be in the resultorder- how to order the resultstartIndex- the index of the first task of all tasks found returnedcount- how many tasks found are returned. -1 for all.returnAllCount- if true the query result methodIQueryResult.getAllCount()returns the overall cases that have been found, if false it returns -1- Returns:
- query result with the tasks
- API:
- This public API is available in Java.
- Security:
- SESSION MATCHES THIS AND OWNS TaskReadAllOwnRoleWorkedOn 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 activator 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
-
findWorkTaskCategories
@Deprecated(since="7.0", forRemoval=true) List<IGroup<ITask>> findWorkTaskCategories(IPropertyFilter<TaskProperty> categoryFilter, TaskProperty categoryProperty, OrderDirection categoryPropertyOrder, EnumSet<TaskState> includeTaskStates) Deprecated, for removal: This API element is subject to removal in a future version.useCategoryTree.createFor(TaskQuery)insteadFinds work task categories. Each category found is returned as a group. A group knows the number of objects contained in the group and one example object of the group.Consider to use the
TaskQueryAPI alternatively. This fluent API makes the statement combinable with other filters and allows SQL-like value comparisons. E.g:TaskQuery query = TaskQuery.create() .where().currentUserCanWorkOn() .and().processCategoryCode().isEqual("MY_CATEGORY_CODE") .groupBy().processCode() .aggregate().countRows(); Recordset rs = ivy.wf.getTaskQueryExecutor().getRecordset(query);- Parameters:
categoryFilter- filters the categoriescategoryProperty- a task property that is used to build the categories (E.g.TaskProperty.PROCESS_CATEGORY_CODE,TaskProperty.PROCESS_CODE,TaskProperty.TYPE_CODE,TaskProperty.SUB_TYPE_CODE,TaskProperty.KIND_CODE)categoryPropertyOrder- the order in which categoryProperty should be ordered in.includeTaskStates- set of task states that should be included.- Returns:
- a list of work task categories
- Throws:
PersistencyException- if persistency access fails- See Also:
- API:
- This public API is available in Java.
- Security:
- SESSION MATCHES THIS AND OWNS TaskCategoriesReadAllOwnWork PERMISSION
-
findWorkedOnTaskCategories
@Deprecated(since="7.0", forRemoval=true) List<IGroup<ITask>> findWorkedOnTaskCategories(IPropertyFilter<TaskProperty> categoryFilter, TaskProperty categoryProperty, OrderDirection categoryPropertyOrder) Deprecated, for removal: This API element is subject to removal in a future version.useCategoryTree.createFor(TaskQuery)insteadFinds worked on task categories. Each category found is returned as a group. A group knows the number of objects contained in the group and one example object of the group.Consider to use the
TaskQueryAPI alternatively. This fluent API makes the statement combinable with other filters and allows SQL-like value comparisons. E.g:* @param categoryFilter filters the categoriesTaskQuery query = TaskQuery.create() .where().currentUserHasWorkedOn() .and().processCategoryCode().isEqual("MY_CATEGORY_CODE") .groupBy().processCode() .aggregate().countRows(); Recordset rs = ivy.wf.getTaskQueryExecutor().getRecordset(query);- Parameters:
categoryProperty- a task property that is used to build the categories (E.g.TaskProperty.PROCESS_CATEGORY_CODE,TaskProperty.PROCESS_CODE,TaskProperty.TYPE_CODE,TaskProperty.SUB_TYPE_CODE,TaskProperty.KIND_CODE)categoryPropertyOrder- the order in which categoryProperty should be ordered in.- Returns:
- a list of worked on task categories
- See Also:
- API:
- This public API is available in Java.
- Security:
- SESSION MATCHES THIS AND OWNS TaskCategoriesReadAllWorkedOn PERMISSION
-
findStartedCaseCategories
@Deprecated(since="7.0", forRemoval=true) List<IGroup<ICase>> findStartedCaseCategories(IPropertyFilter<CaseProperty> categoryFilter, CaseProperty categoryProperty, OrderDirection categoryPropertyOrder) Deprecated, for removal: This API element is subject to removal in a future version.useCategoryTree.createFor(CaseQuery)insteadFinds started cases categories. Each category found is returned as a group. A group knows the number of objects contained in the group and one example object of the group.Consider to use the
CaseQueryAPI alternatively. This fluent API makes the statement combinable with other filters and allows SQL-like value comparisons. E.g:CaseQuery query = CaseQuery.create() .where().currentUserHasStarted() .and().processCategoryCode().isEqual("MY_CATEGORY_CODE") .groupBy().processCode() .aggregate().countRows(); Recordset rs = ivy.wf.getCaseQueryExecutor().getRecordset(query);- Parameters:
categoryFilter- filters the categoriescategoryProperty- a case property that is used to build the categories (E.g.CaseProperty.PROCESS_CATEGORY_CODE,CaseProperty.PROCESS_CODE,CaseProperty.TYPE_CODE,CaseProperty.SUB_TYPE_CODE)categoryPropertyOrder- the order in which categoryProperty should be ordered in.- Returns:
- a list of started case categories
- Throws:
PersistencyException- if persistency access fails- See Also:
- API:
- This public API is available in Java.
- Security:
- SESSION MATCHES THIS AND OWNS CaseCategoriesReadAllOwnStarted PERMISSION
-
findInvolvedCases
@Deprecated(since="12.0.0", forRemoval=true) IQueryResult<ICase> findInvolvedCases(IPropertyFilter<CaseProperty> filter, List<PropertyOrder<CaseProperty>> order, int startIndex, int count, boolean returnAllCount) Deprecated, for removal: This API element is subject to removal in a future version.useCaseQueryFinds cases in which the session user is involved. The session user may be involved in a case if:- he is the creator of the case
- he has worked or is working on a task of the case.
- he can work on a task of the case. Either because he is the activator of the task or the activator of the task is a role he owns.
Consider to use the
CaseQueryAPI alternatively. This fluent API makes the statement combinable with other filters and allows SQL-like value comparisons. E.g:CaseQuery query = CaseQuery.create() .where().currentUserIsInvolved(); List<ICase> cases = ivy.wf.getCaseQueryExecutor().getResults(query, startIndex, count);
- Parameters:
filter- filter criteria to specify which cases should be in the resultorder- how to order the resultstartIndex- the index of the first case of all cases found returnedcount- how many cases found are returned. -1 for all.returnAllCount- if true the query result methodIQueryResult.getAllCount()returns the overall cases that have been found, if false it returns -1- Returns:
- query result with the cases
- Throws:
PersistencyException- if persistency access fails- See Also:
- API:
- This public API is available in Java.
- Security:
- SESSION MATCHES THIS AND OWNS CaseReadAllOwnInvolved PERMISSION
-
findInvolvedCasesCategories
@Deprecated(since="7.0", forRemoval=true) List<IGroup<ICase>> findInvolvedCasesCategories(IPropertyFilter<CaseProperty> categoryFilter, CaseProperty categoryProperty, OrderDirection categoryPropertyOrder) Deprecated, for removal: This API element is subject to removal in a future version.useCategoryTree.createFor(CaseQuery)insteadFinds case categories of cases in which the session user is involved. The session user may be involved in a case if:- he is the creator of the case
- he has worked or is working on a task of the case.
- he can work on a task of the case. Either because he is the activator of the task or the activator of the task is a role he owns.
Consider to use the
CaseQueryAPI alternatively. This fluent API makes the statement combinable with other filters and allows SQL-like value comparisons. E.g:CaseQuery query = CaseQuery.create() .where().currentUserIsInvolved() .and().processCategoryCode().isEqual("MY_CATEGORY_CODE") .groupBy().processCode() .aggregate().countRows(); Recordset rs = ivy.wf.getCaseQueryExecutor().getRecordset(query);- Parameters:
categoryFilter- filters the categoriescategoryProperty- a case property that is used to build the categories (E.g.CaseProperty.PROCESS_CATEGORY_CODE,CaseProperty.PROCESS_CODE,CaseProperty.TYPE_CODE,CaseProperty.SUB_TYPE_CODE)categoryPropertyOrder- the order in which categoryProperty should be ordered in.- Returns:
- a list of involved case categories
- Throws:
PersistencyException- if persistency access fails- See Also:
- API:
- This public API is available in Java.
- Security:
- SESSION MATCHES THIS AND OWNS CaseCategoriesReadAllOwnInvolved PERMISSION
-
findInvolvedCasesByRole
@Deprecated(since="12.0.0", forRemoval=true) IQueryResult<ICase> findInvolvedCasesByRole(List<IRole> roles, IPropertyFilter<CaseProperty> filter, List<PropertyOrder<CaseProperty>> order, int startIndex, int count, boolean returnAllCount) Deprecated, for removal: This API element is subject to removal in a future version.useCaseQueryFinds cases in which the session user is involved. The session user may be involved in a case if:- he is the creator of the case
- one of his colleagues has started the case but he would have been also able to start the case
- he has worked or is working on a task of the case.
- one of his colleagues has worked or is working on a task of the case and he would have been also able to work on the task because the activator of the task was a role that is in the roles parameter list.
- he can work on a task of the case. Either because he is the activator of the task or the activator of the task is a role he owns.
- Parameters:
roles- filters the roles. Only roles are allowed that the workflow users owns.filter- filter criteria to specify which cases should be in the resultorder- how to order the resultstartIndex- the index of the first case of all cases found returnedcount- how many cases found are returned. -1 for all.returnAllCount- if true the query result methodIQueryResult.getAllCount()returns the overall cases that have been found, if false it returns -1- Returns:
- query result with the cases
- Throws:
PersistencyException- if persistency access fails- API:
- This public API is available in Java.
- Security:
- SESSION MATCHES THIS AND OWNS CaseReadAllOwnRoleInvolved PERMISSION
-
findInvolvedCasesByRole
@Deprecated(since="12.0.0", forRemoval=true) IQueryResult<ICase> findInvolvedCasesByRole(InvolvedCasesByRoleQuery query) Deprecated, for removal: This API element is subject to removal in a future version.useCaseQueryFinds cases in which the session user is involved. The session user may be involved in a case if:- he is the creator of the case
- one of his colleagues has started the case but he would have been also able to start the case (if includeProcessStarts is true on the parameter object)
- he has worked or is working on a task of the case.
- one of his colleagues has worked or is working on a task of the case and he would have been also able to work on the task because the activator of the task was a role that is in the roles parameter list.
- he can work on a task of the case. Either because he is the activator of the task or the activator of the task is a role he owns.
- Parameters:
query- contains all query parameters which are equivalent tofindInvolvedCasesByRole(java.util.List<ch.ivyteam.ivy.security.IRole>, ch.ivyteam.ivy.workflow.IPropertyFilter<ch.ivyteam.ivy.workflow.CaseProperty>, java.util.List<ch.ivyteam.ivy.workflow.PropertyOrder<ch.ivyteam.ivy.workflow.CaseProperty>>, int, int, boolean)- Returns:
- query result with the cases
- Throws:
PersistencyException- if persistency access fails- Since:
- 6.6
- API:
- This public API is available in Java.
- Security:
- SESSION MATCHES THIS AND OWNS CaseReadAllOwnRoleInvolved PERMISSION
-
findInvolvedCasesByRoleCategories
@Deprecated(since="7.0", forRemoval=true) List<IGroup<ICase>> findInvolvedCasesByRoleCategories(List<IRole> roles, IPropertyFilter<CaseProperty> categoryFilter, CaseProperty categoryProperty, OrderDirection categoryPropertyOrder) Deprecated, for removal: This API element is subject to removal in a future version.useCategoryTree.createFor(CaseQuery)insteadFinds case categories of cases in which the session user is involved. The session user may be involved in a case if:- he is the creator of the case
- one of his colleagues has started the case but he would have been also able to start the case
- he has worked or is working on a task of the case.
- one of his colleagues has worked or is working on a task of the case and he would have been also able to work on the task because the activator of the task was a role that is in the roles parameter list.
- he can work on a task of the case. Either because he is the activator of the task or the activator of the task is a role he owns.
- Parameters:
roles- filters the roles. Only roles are allowed that the workflow users owns.categoryFilter- filters the categoriescategoryProperty- a case property that is used to build the categories (E.g.CaseProperty.PROCESS_CATEGORY_CODE,CaseProperty.PROCESS_CODE,CaseProperty.TYPE_CODE,CaseProperty.SUB_TYPE_CODE)categoryPropertyOrder- the order in which categoryProperty should be ordered in.- Returns:
- a list of involved case categories
- Throws:
PersistencyException- if persistency access fails- API:
- This public API is available in Java.
- Security:
- SESSION MATCHES THIS AND OWNS CaseCategoriesReadAllOwnRoleInvolved 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.
-
TaskQuery