Interface IWorkflowSession
-
- All Superinterfaces:
org.eclipse.core.runtime.IAdaptable
,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 Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description ITask
createTaskAndCase(IProcessStart processStart)
Starts a new task and creates a case for a process.List<ITask>
findCreatedAndResumedWorkTasks(int startIndex, int count)
Gets all tasks the workflow session user can work on that are in stateTaskState.RESUMED
orTaskState.CREATED
.IQueryResult<ICase>
findInvolvedCases(IPropertyFilter<CaseProperty> filter, List<PropertyOrder<CaseProperty>> order, int startIndex, int count, boolean returnAllCount)
Finds cases in which the session user is involved.IQueryResult<ICase>
findInvolvedCasesByRole(InvolvedCasesByRoleQuery query)
Finds cases in which the session user is involved.IQueryResult<ICase>
findInvolvedCasesByRole(List<IRole> roles, IPropertyFilter<CaseProperty> filter, List<PropertyOrder<CaseProperty>> order, int startIndex, int count, boolean returnAllCount)
Finds cases in which the session user is involved.List<IGroup<ICase>>
findInvolvedCasesByRoleCategories(List<IRole> roles, IPropertyFilter<CaseProperty> categoryFilter, CaseProperty categoryProperty, OrderDirection categoryPropertyOrder)
Deprecated.useCategoryTree.createFor(CaseQuery)
insteadList<IGroup<ICase>>
findInvolvedCasesCategories(IPropertyFilter<CaseProperty> categoryFilter, CaseProperty categoryProperty, OrderDirection categoryPropertyOrder)
Deprecated.useCategoryTree.createFor(CaseQuery)
insteadIQueryResult<ITask>
findLockedWorkTasks(IPropertyFilter<TaskProperty> filter, List<PropertyOrder<TaskProperty>> order, int startIndex, int count, boolean returnAllCount, EnumSet<TaskState> includeTaskStates)
Gets all tasks the workflow session user could work if they were in stateTaskState.SUSPENDED
but are currently in stateTaskState.RESUMED
orTaskState.PARKED
because other users are working on them.List<ITask>
findParkedWorkTasks(int startIndex, int count)
Gets all tasks the workflow session user can work on that are in stateTaskState.PARKED
.List<ITask>
findResumedWorkTasks(int startIndex, int count)
Gets all tasks the workflow session user can work on that are in stateTaskState.RESUMED
.List<IGroup<ICase>>
findStartedCaseCategories(IPropertyFilter<CaseProperty> categoryFilter, CaseProperty categoryProperty, OrderDirection categoryPropertyOrder)
Deprecated.useCategoryTree.createFor(CaseQuery)
insteadList<ICase>
findStartedCases(int startIndex, int count, Date caseStartTimestampFilter)
Finds all cases that the session users has started.IQueryResult<ICase>
findStartedCases(IPropertyFilter<CaseProperty> filter, List<PropertyOrder<CaseProperty>> order, int startIndex, int count, boolean returnAllCount)
Finds all cases that the session users has started.IQueryResult<ICase>
findStartedCasesByRole(List<IRole> roles, IPropertyFilter<CaseProperty> filter, List<PropertyOrder<CaseProperty>> order, int startIndex, int count, boolean returnAllCount)
Gets all cases somebody has started who needs a role to start the case which the current session user also owns.List<ITask>
findSuspendedAndParkedWorkTasks(int startIndex, int count)
Gets all tasks the workflow session user can work on that are in stateTaskState.SUSPENDED
orTaskState.PARKED
.List<ITask>
findSuspendedWorkTasks(int startIndex, int count)
Gets all tasks the workflow session user can work on that are in stateTaskState.SUSPENDED
.List<IGroup<ITask>>
findWorkedOnTaskCategories(IPropertyFilter<TaskProperty> categoryFilter, TaskProperty categoryProperty, OrderDirection categoryPropertyOrder)
Deprecated.useCategoryTree.createFor(TaskQuery)
insteadList<ITask>
findWorkedOnTasks(int startIndex, int count, Date taskEndTimestampFilter)
Finds all tasks that the session users has ever worked on.IQueryResult<ITask>
findWorkedOnTasks(IPropertyFilter<TaskProperty> filter, List<PropertyOrder<TaskProperty>> order, int startIndex, int count, boolean returnAllCount)
Finds all tasks that the session user has ever worked onIQueryResult<ITask>
findWorkedOnTasksByRole(List<IRole> roles, IPropertyFilter<TaskProperty> filter, List<PropertyOrder<TaskProperty>> order, int startIndex, int count, boolean returnAllCount)
Returns all tasks the session user has worked on or could have worked on as member of the given roles.ITask
findWorkingTask(int taskIdentifier)
Deprecated.UsefindWorkingTask(long)
instead.ITask
findWorkingTask(long taskIdentifier)
Finds a task the current session user is working on (task stateTaskState.RESUMED
orTaskState.CREATED
) with its identifier.List<IGroup<ITask>>
findWorkTaskCategories(IPropertyFilter<TaskProperty> categoryFilter, TaskProperty categoryProperty, OrderDirection categoryPropertyOrder, EnumSet<TaskState> includeTaskStates)
Deprecated.useCategoryTree.createFor(TaskQuery)
insteadIQueryResult<ITask>
findWorkTasks(IPropertyFilter<TaskProperty> filter, List<PropertyOrder<TaskProperty>> order, int startIndex, int count, boolean returnAllCount, EnumSet<TaskState> includeTaskStates)
Gets all tasks the workflow session user can work on.List<IProcessStart>
getStartableProcessStarts()
Returns all process start elements which the current user can start.List<IWebStartable>
getStartables()
Returns all startables which the current user can start.IWorkflowContext
getWorkflowContext()
Gets the workflow contextvoid
parkTask(ITask task)
Parks/reserves a running task for the current session user.void
resetTask(ITask runningTask)
Resets a task the workflow session user is working on.ITask
resumeTask(int taskIdentifier)
Deprecated.useresumeTask(long)
insteadITask
resumeTask(long taskIdentifier)
Resumes a suspended or parked task with its identifier.-
Methods inherited from interface ch.ivyteam.util.IAttributeStore
getAttribute, getAttributeNames, removeAttribute, setAttribute
-
Methods inherited from interface ch.ivyteam.ivy.security.ISession
assignRole, checkPassword, checkPermission, getActiveEnvironment, getActiveSubstitutions, getClusterNode, getContentLocale, getFormattingLocale, getIdentifier, getMySessions, getSecurityContext, getSessionUser, getSessionUserName, hasActiveSubstitutions, hasMoreThanOneSession, hasPermission, isAbsent, isMemberThroughActiveSubstitution, isMemberThroughActiveSubstitution, isSessionUserSystemUser, isSessionUserUnknown, loginSessionUser, logoutSessionUser, setActiveEnvironment, setContentLocale, setContentLocale, setFormattingLocale, setFormattingLocale
-
Methods inherited from interface ch.ivyteam.ivy.security.IUserToken
canActAsUser, hasRole
-
-
-
-
Method Detail
-
getWorkflowContext
IWorkflowContext getWorkflowContext()
Gets the workflow context- Returns:
- workflow context
- API:
- This public API is available in IvyScript and Java. It has the visibility EXPERT.
-
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 IvyScript and Java. It has the visibility NOVICE.
- Security:
- SESSION MATCHES THIS AND (MATCHES THIS.UserUnknown OR (MATCHES THIS.UserKnown AND OWNS ProcessStartReadAllOwnStartable PERMISSION))
-
getStartables
List<IWebStartable> getStartables()
Returns all startables which the current user can start.- Returns:
- startables
- Since:
- 6.6.2
- API:
- This public API is available in IvyScript and Java. It has the visibility NOVICE.
-
findWorkingTask
ITask findWorkingTask(long taskIdentifier)
Finds a task the current session user is working on (task stateTaskState.RESUMED
orTaskState.CREATED
) with its identifier. Returns null if task does not exists or is not in stateTaskState.RESUMED
orTaskState.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
-
findWorkingTask
@Deprecated ITask findWorkingTask(int taskIdentifier)
Deprecated.UsefindWorkingTask(long)
instead.- Parameters:
taskIdentifier
-- Returns:
- -
- Throws:
PersistencyException
- API:
- This public API is available in Java.
-
findWorkTasks
IQueryResult<ITask> findWorkTasks(IPropertyFilter<TaskProperty> filter, List<PropertyOrder<TaskProperty>> order, int startIndex, int count, boolean returnAllCount, EnumSet<TaskState> includeTaskStates)
Gets all tasks the workflow session user can work on.
If includeTaskStates contains state
TaskState.SUSPENDED
all tasks in stateTaskState.SUSPENDED
that the workflow session user can resume are also included in the result.If includeTaskStates contains state
TaskState.CREATED
all tasks in stateTaskState.CREATED
that the workflow session user are working on are also included in the result.If includeTaskStates contains state
TaskState.RESUMED
all tasks in stateTaskState.RESUMED
that the workflow session user are working on are also included in the result.If includeTaskStates contains state
TaskState.PARKED
all tasks in stateTaskState.PARKED
that the workflow session user can resume are also included in the result.Consider to use the
TaskQuery
API 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:
TaskQuery
,IWorkflowContext.getTaskQueryExecutor()
- API:
- This public API is available in IvyScript and Java. It has the visibility ADVANCED.
- Security:
- SESSION MATCHES THIS AND OWNS TaskReadAllOwnWork PERMISSION
-
findSuspendedWorkTasks
List<ITask> findSuspendedWorkTasks(int startIndex, int count)
Gets 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
TaskQuery
API 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:
TaskQuery
,IWorkflowContext.getTaskQueryExecutor()
- API:
- This public API is available in IvyScript and Java. It has the visibility NOVICE.
- Security:
- SESSION MATCHES THIS AND OWNS TaskReadAllOwnWork PERMISSION
-
findSuspendedAndParkedWorkTasks
List<ITask> findSuspendedAndParkedWorkTasks(int startIndex, int count)
Gets all tasks the workflow session user can work on that are in stateTaskState.SUSPENDED
orTaskState.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
TaskQuery
API 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:
TaskQuery
,IWorkflowContext.getTaskQueryExecutor()
- API:
- This public API is available in IvyScript and Java. It has the visibility NOVICE.
- Security:
- SESSION MATCHES THIS AND OWNS TaskReadAllOwnWork PERMISSION
-
findParkedWorkTasks
List<ITask> findParkedWorkTasks(int startIndex, int count)
Gets 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
TaskQuery
API 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:
TaskQuery
,IWorkflowContext.getTaskQueryExecutor()
- API:
- This public API is available in IvyScript and Java. It has the visibility NOVICE.
- Security:
- SESSION MATCHES THIS AND OWNS TaskReadAllOwnWork PERMISSION
-
findResumedWorkTasks
List<ITask> findResumedWorkTasks(int startIndex, int count)
Gets 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
TaskQuery
API 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:
TaskQuery
,IWorkflowContext.getTaskQueryExecutor()
- API:
- This public API is available in IvyScript and Java. It has the visibility NOVICE.
- Security:
- SESSION MATCHES THIS AND OWNS TaskReadAllOwnWork PERMISSION
-
findCreatedAndResumedWorkTasks
List<ITask> findCreatedAndResumedWorkTasks(int startIndex, int count)
Gets all tasks the workflow session user can work on that are in stateTaskState.RESUMED
orTaskState.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
TaskQuery
API 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:
TaskQuery
,IWorkflowContext.getTaskQueryExecutor()
- API:
- This public API is available in IvyScript and Java. It has the visibility NOVICE.
- Security:
- SESSION MATCHES THIS AND OWNS TaskReadAllOwnWork PERMISSION
-
findLockedWorkTasks
IQueryResult<ITask> findLockedWorkTasks(IPropertyFilter<TaskProperty> filter, List<PropertyOrder<TaskProperty>> order, int startIndex, int count, boolean returnAllCount, EnumSet<TaskState> includeTaskStates)
Gets all tasks the workflow session user could work if they were in state
TaskState.SUSPENDED
but are currently in stateTaskState.RESUMED
orTaskState.PARKED
because other users are working on them.If includeTaskStates contains state
TaskState.RESUMED
all tasks in stateTaskState.RESUMED
that the workflow session user could resume are also included in the result.If includeTaskStates contains state
TaskState.PARKED
all tasks in stateTaskState.PARKED
that 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 IvyScript and Java. It has the visibility ADVANCED.
- Security:
- SESSION MATCHES THIS AND OWNS TaskReadAllOwnLocked PERMISSION
-
findStartedCases
IQueryResult<ICase> findStartedCases(IPropertyFilter<CaseProperty> filter, List<PropertyOrder<CaseProperty>> order, int startIndex, int count, boolean returnAllCount)
Finds all cases that the session users has started.Consider to use the
CaseQuery
API 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:
CaseQuery
,IWorkflowContext.getCaseQueryExecutor()
- API:
- This public API is available in IvyScript and Java. It has the visibility ADVANCED.
- Security:
- SESSION MATCHES THIS AND OWNS CaseReadAllOwnStarted PERMISSION
-
findStartedCases
List<ICase> findStartedCases(int startIndex, int count, Date caseStartTimestampFilter)
Finds 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
CaseQuery
API 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:
CaseQuery
,IWorkflowContext.getCaseQueryExecutor()
- API:
- This public API is available in IvyScript and Java. It has the visibility ADVANCED.
- Security:
- SESSION MATCHES THIS AND OWNS CaseReadAllOwnStarted PERMISSION
-
findStartedCasesByRole
IQueryResult<ICase> findStartedCasesByRole(List<IRole> roles, IPropertyFilter<CaseProperty> filter, List<PropertyOrder<CaseProperty>> order, int startIndex, int count, boolean returnAllCount)
Gets 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 IvyScript and Java. It has the visibility ADVANCED.
- Security:
- SESSION MATCHES THIS AND OWNS CaseReadAllOwnRoleStarted PERMISSION
-
findWorkedOnTasks
IQueryResult<ITask> findWorkedOnTasks(IPropertyFilter<TaskProperty> filter, List<PropertyOrder<TaskProperty>> order, int startIndex, int count, boolean returnAllCount)
Finds all tasks that the session user has ever worked onConsider to use the
TaskQuery
API 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:
TaskQuery
,IWorkflowContext.getTaskQueryExecutor()
- API:
- This public API is available in IvyScript and Java. It has the visibility ADVANCED.
- Security:
- SESSION MATCHES THIS AND OWNS TaskReadAllOwnWorkedOn PERMISSION
-
findWorkedOnTasks
List<ITask> findWorkedOnTasks(int startIndex, int count, Date taskEndTimestampFilter)
Finds 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
TaskQuery
API 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:
TaskQuery
,IWorkflowContext.getTaskQueryExecutor()
- API:
- This public API is available in IvyScript and Java. It has the visibility ADVANCED.
- Security:
- SESSION MATCHES THIS AND OWNS TaskReadAllOwnWorkedOn PERMISSION
-
findWorkedOnTasksByRole
IQueryResult<ITask> findWorkedOnTasksByRole(List<IRole> roles, IPropertyFilter<TaskProperty> filter, List<PropertyOrder<TaskProperty>> order, int startIndex, int count, boolean returnAllCount)
Returns 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 IvyScript and Java. It has the visibility ADVANCED.
- Security:
- SESSION MATCHES THIS AND OWNS TaskReadAllOwnRoleWorkedOn PERMISSION
-
createTaskAndCase
ITask createTaskAndCase(IProcessStart processStart)
Starts a new task and creates a case for a process. The returned task is in stateTaskState.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:
- the task does not exists
- is not in state
TaskState.SUSPENDED
orTaskState.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.SUSPENDED
or 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:
resumeTask(long, String)
- API:
- This public API is available in Java.
- Security:
- SESSION IS SYSTEM
-
resumeTask
@Deprecated ITask resumeTask(int taskIdentifier)
Deprecated.useresumeTask(long)
instead- Parameters:
taskIdentifier
-- Returns:
- -
- Throws:
PersistencyException
- API:
- This public API is available in Java.
-
resetTask
void resetTask(ITask runningTask)
Resets a task the workflow session user is working on.
A task that is in state
TaskState.CREATED
is in stateTaskState.ZOMBIE
afterwardsA task that is in state
TaskState.RESUMED
orTaskState.PARKED
is in stateTaskState.SUSPENDED
orTaskState.UNASSIGNED
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
orTaskState.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 IvyScript and Java. It has the visibility EXPERT.
- Security:
- SESSION MATCHES THIS AND OWNS TaskParkOwnWorkingTask PERMISSION
-
findWorkTaskCategories
@Deprecated List<IGroup<ITask>> findWorkTaskCategories(IPropertyFilter<TaskProperty> categoryFilter, TaskProperty categoryProperty, OrderDirection categoryPropertyOrder, EnumSet<TaskState> includeTaskStates)
Deprecated.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
TaskQuery
API 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:
TaskQuery
,IWorkflowContext.getTaskQueryExecutor()
- API:
- This public API is available in IvyScript and Java. It has the visibility EXPERT.
- Security:
- SESSION MATCHES THIS AND OWNS TaskCategoriesReadAllOwnWork PERMISSION
-
findWorkedOnTaskCategories
@Deprecated List<IGroup<ITask>> findWorkedOnTaskCategories(IPropertyFilter<TaskProperty> categoryFilter, TaskProperty categoryProperty, OrderDirection categoryPropertyOrder)
Deprecated.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
TaskQuery
API 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:
TaskQuery
,IWorkflowContext.getTaskQueryExecutor()
- API:
- This public API is available in IvyScript and Java. It has the visibility EXPERT.
- Security:
- SESSION MATCHES THIS AND OWNS TaskCategoriesReadAllWorkedOn PERMISSION
-
findStartedCaseCategories
@Deprecated List<IGroup<ICase>> findStartedCaseCategories(IPropertyFilter<CaseProperty> categoryFilter, CaseProperty categoryProperty, OrderDirection categoryPropertyOrder)
Deprecated.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
CaseQuery
API 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:
CaseQuery
,IWorkflowContext.getCaseQueryExecutor()
- API:
- This public API is available in IvyScript and Java. It has the visibility EXPERT.
- Security:
- SESSION MATCHES THIS AND OWNS CaseCategoriesReadAllOwnStarted PERMISSION
-
findInvolvedCases
IQueryResult<ICase> findInvolvedCases(IPropertyFilter<CaseProperty> filter, List<PropertyOrder<CaseProperty>> order, int startIndex, int count, boolean returnAllCount)
Finds 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
CaseQuery
API 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:
CaseQuery
,IWorkflowContext.getCaseQueryExecutor()
- API:
- This public API is available in IvyScript and Java. It has the visibility EXPERT.
- Security:
- SESSION MATCHES THIS AND OWNS CaseReadAllOwnInvolved PERMISSION
-
findInvolvedCasesCategories
@Deprecated List<IGroup<ICase>> findInvolvedCasesCategories(IPropertyFilter<CaseProperty> categoryFilter, CaseProperty categoryProperty, OrderDirection categoryPropertyOrder)
Deprecated.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
CaseQuery
API 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:
CaseQuery
,IWorkflowContext.getCaseQueryExecutor()
- API:
- This public API is available in IvyScript and Java. It has the visibility EXPERT.
- Security:
- SESSION MATCHES THIS AND OWNS CaseCategoriesReadAllOwnInvolved PERMISSION
-
findInvolvedCasesByRole
IQueryResult<ICase> findInvolvedCasesByRole(List<IRole> roles, IPropertyFilter<CaseProperty> filter, List<PropertyOrder<CaseProperty>> order, int startIndex, int count, boolean returnAllCount)
Finds 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 IvyScript and Java. It has the visibility EXPERT.
- Security:
- SESSION MATCHES THIS AND OWNS CaseReadAllOwnRoleInvolved PERMISSION
-
findInvolvedCasesByRole
IQueryResult<ICase> findInvolvedCasesByRole(InvolvedCasesByRoleQuery query)
Finds 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 IvyScript and Java. It has the visibility EXPERT.
- Security:
- SESSION MATCHES THIS AND OWNS CaseReadAllOwnRoleInvolved PERMISSION
-
findInvolvedCasesByRoleCategories
@Deprecated List<IGroup<ICase>> findInvolvedCasesByRoleCategories(List<IRole> roles, IPropertyFilter<CaseProperty> categoryFilter, CaseProperty categoryProperty, OrderDirection categoryPropertyOrder)
Deprecated.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 IvyScript and Java. It has the visibility EXPERT.
- Security:
- SESSION MATCHES THIS AND OWNS CaseCategoriesReadAllOwnRoleInvolved PERMISSION
-
-