Interface IWorkflowContext
- Since:
- 17.05.2006
- API:
- This is a public API.
-
Method Summary
Modifier and TypeMethodDescriptioncreateCasePropertyFilter
(CaseProperty property, RelationalOperator operator, Object value) Creates a case property filter.createIntermediateEventPropertyFilter
(IntermediateEventProperty property, RelationalOperator operator, Object value) Creates an intermediate event property filter.createTaskPropertyFilter
(TaskProperty property, RelationalOperator operator, Object value) Creates a task property filter.createWorkflowEventPropertyFilter
(WorkflowEventProperty property, RelationalOperator operator, Object value) Creates a workflow event property filter.static IWorkflowContext
current()
Gets the current workflow context.void
deleteCompletedCase
(ICase completedCase) Deletes the given completed case and all belonging objects (tasks, workflow events, notes, process data etc.).Returns a service for managing documents of this workflow context.findCase
(long caseId) Finds a case by its ID.Finds a case by its UUID.findCaseCategories
(IPropertyFilter<CaseProperty> categoryFilter, CaseProperty categoryProperty, OrderDirection categoryPropertyOrder) Deprecated, for removal: This API element is subject to removal in a future version.findCases
(IPropertyFilter<CaseProperty> filter, List<PropertyOrder<CaseProperty>> order, int startIndex, int count, boolean returnAllCount) Find cases using a filterfindCases
(String propertyName, String propertyValue, int startIndex, int count, boolean returnAllCount) Deprecated, for removal: This API element is subject to removal in a future version.use
insteadCaseQuery
.create().where().customField()
.textField(propertyName)
.isLike(propertyValue).executor().results(startIndex, count)findIntermediateEvents
(IPropertyFilter<IntermediateEventProperty> filter, List<PropertyOrder<IntermediateEventProperty>> order, int startIndex, int count, boolean returnAllCount) Finds intermediate eventsfindProcessStartsBySignature
(String signature) Finds all process starts that have the given signature.findStartable
(IUser user, String id) Returns an optional startable for the given id that the user can start.findStartable
(String id) Returns an optional startable for the given id.findTask
(long taskId) Finds a task by its ID.Finds a task by its UUID.findTaskCategories
(IPropertyFilter<TaskProperty> categoryFilter, TaskProperty categoryProperty, OrderDirection categoryPropertyOrder) Deprecated, for removal: This API element is subject to removal in a future version.useCategoryTree.createFor(TaskQuery)
insteadfindTasks
(IPropertyFilter<TaskProperty> filter, List<PropertyOrder<TaskProperty>> order, int startIndex, int count, boolean returnAllCount) Find tasks using a filter.findTasks
(String propertyName, String propertyValue, int startIndex, int count, boolean returnAllCount) Deprecated, for removal: This API element is subject to removal in a future version.use
insteadTaskQuery
.create().where().customField()
.textField(propertyName)
.isLike(propertyValue).executor().results(startIndex, count)findWorkflowEvents
(IPropertyFilter<WorkflowEventProperty> filter, List<PropertyOrder<WorkflowEventProperty>> order, int startIndex, int count, boolean returnAllCount) Finds workflow events.findWorkTasks
(IUser user, int startIndex, int count) Finds tasks that a given user can work on (currently working or can start).findWorkTasks
(IUser user, IPropertyFilter<TaskProperty> filter, List<PropertyOrder<TaskProperty>> order, int startIndex, int count, boolean returnAllCount, EnumSet<TaskState> includeTaskStates) Finds tasks that a given user can work on (currently working or can start).fireIntermediateEvent
(IIntermediateEventElement intermediateEventElement, String eventIdentifier, Object resultObject, String additionalInformation) Fires an intermediate event.Deprecated, for removal: This API element is subject to removal in a future version.useIApplication.current()
to get the current applicationExecutor forcase queries
on this workflow context.int
Gets the number of running cases of a application.int
getRunningCasesCount
(IProcessModelVersion processModelVersion) Gets the number of running cases of a process model version.Gets the security context that is responsible for the security of this workflow context.Returns all process start elements which the given user can start.getStartables
(IUser user) Returns all startables which the given user can start.Executor fortask queries
on this workflow context.getWorkflowSession
(ISession session) Gets the workflow session that belongs to the given security session.signals()
A service for sending and querying signals.
-
Method Details
-
getApplication
Deprecated, for removal: This API element is subject to removal in a future version.useIApplication.current()
to get the current applicationIf this is the current workflow context then the current application is returned otherwise the first application that uses to this workflow context is returned.- Returns:
- the application
- Throws:
PersistencyException
- if persistency access failsIllegalStateException
- if no application uses this workflow context- API:
- This public API is available in Java.
-
getSecurityContext
ISecurityContext getSecurityContext()Gets the security context that is responsible for the security of this workflow context.- Returns:
- the security context
- Throws:
PersistencyException
- if persistency access fails- API:
- This public API is available in Java.
-
createCasePropertyFilter
IPropertyFilter<CaseProperty> createCasePropertyFilter(CaseProperty property, RelationalOperator operator, Object value) Creates a case property filter.
Case property filters can be used to filter cases in the findCase methods like
findCases(IPropertyFilter, List, int, int, boolean)
Example:
IPropertyFilter
filterName = ivy.wf.createCasePropertyFilter(CaseProperty.NAME, RelationalOperator.LIKE, "W%"));
IPropertyFilterfilterPriority = ivy.wf.createCasePropertyFilter(CaseProperty.PRIORITY, RelationalOperator.EQUAL, WorkflowPriority.NORMAL.intValue());
IPropertyFilterfilter = filterName.and(filterPriority); - Parameters:
property
- the case property to filter withoperator
- the filter operatorvalue
- the value to filter for. Can be null. Must respect the type of the property. I.e. the name property should have a String value.- Returns:
- case property filter
- API:
- This public API is available in Java.
-
createTaskPropertyFilter
IPropertyFilter<TaskProperty> createTaskPropertyFilter(TaskProperty property, RelationalOperator operator, Object value) Creates a task property filter.
Task property filters can be used to filter tasks in the findTask methods like
findTasks(IPropertyFilter, List, int, int, boolean)
Example:
IPropertyFilter
filterName = ivy.wf.createTaskPropertyFilter(TaskProperty.NAME, RelationalOperator.LIKE, "W%")
IPropertyFilterfilterPriority = ivy.wf.createTaskPropertyFilter(TaskProperty.PRIORITY, RelationalOperator.EQUAL, WorkflowPriority.NORMAL.intValue());
IPropertyFilterfilter = filterName.and(filterPriority); - Parameters:
property
- the case property to filter withoperator
- the filter operatorvalue
- the value to filter for. Can be null. Must respect the type of the property. I.e. the name property should have a String value.- Returns:
- task property filter
- API:
- This public API is available in Java.
-
createWorkflowEventPropertyFilter
IPropertyFilter<WorkflowEventProperty> createWorkflowEventPropertyFilter(WorkflowEventProperty property, RelationalOperator operator, Object value) Creates a workflow event property filter.
Workflow Event property filters can be used to filter workflow events in the findWorkflowEvent methods like
findWorkflowEvents(IPropertyFilter, List, int, int, boolean)
Example:
IPropertyFilter
filterUserName = ivy.wf.createWorkflowEventPropertyFilter(WorkflowEventProperty.USER_NAME, RelationalOperator.LIKE, "W%"));
IPropertyFilterfilterCreateCase = ivy.wf.createWorkflowEventPropertyFilter(WorkflowEventProperty.EVENT_KIND, RelationalOperator.EQUAL, WorkflowEventKind.EVENT_CREATE_CASE.intValue());
IPropertyFilterfilter = filterUserName.and(filterCreateCase); - Parameters:
property
- the case property to filter withoperator
- the filter operatorvalue
- the value to filter for. Can be null. Must respect the type of the property. I.e. the username property should have a String value.- Returns:
- workflow event property filter
- API:
- This public API is available in Java.
-
createIntermediateEventPropertyFilter
IPropertyFilter<IntermediateEventProperty> createIntermediateEventPropertyFilter(IntermediateEventProperty property, RelationalOperator operator, Object value) Creates an intermediate event property filter.
Workflow Event property filters can be used to filter workflow events in the findWorkflowEvent methods like
findWorkflowEvents(IPropertyFilter, List, int, int, boolean)
Example:
IPropertyFilter
filterTimeout = ivy.wf.createIntermediateEventPropertyFilter(IntermediateEventProperty.TIMEOUT_ACTION, RelationalOperator.EQUAL, IntermediateEventTimeoutAction.NOTHING.intValue()); IPropertyFilter filterWaiting = ivy.wf.createIntermediateEventPropertyFilter(IntermediateEventProperty.STATE, RelationalOperator.EQUAL, IntermediateEventState.WAITING.intValue()); IPropertyFilter filter = filterTimeout.or(filterWaiting); - Parameters:
property
- the intermediate event property to filter withoperator
- the filter operatorvalue
- the value to filter for. Can be null. Must respect the type of the property. I.e. the taskId property should be an integer value.- Returns:
- intermediate event property filter
- API:
- This public API is available in Java.
-
findCase
Finds a case by its ID.- Parameters:
caseId
- the case identifier- Returns:
- the case or null if case is not found
- Throws:
PersistencyException
- if persistency access fails- API:
- This public API is available in Java.
- Security:
- SESSION OWNS CaseRead PERMISSION OR OWNS CaseRead@SYSTEM PERMISSION
-
findCase
Finds a case by its UUID.- Parameters:
uuid
- the uuid of the case- Returns:
- the case or null if case is not found
- Throws:
PersistencyException
- if persistency access fails- API:
- This public API is available in Java.
-
findCases
@Deprecated(since="7.3", forRemoval=true) IQueryResult<ICase> findCases(String propertyName, String propertyValue, int startIndex, int count, boolean returnAllCount) Deprecated, for removal: This API element is subject to removal in a future version.use
insteadCaseQuery
.create().where().customField()
.textField(propertyName)
.isLike(propertyValue).executor().results(startIndex, count)Finds all cases which have an additional property with the given name and value.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().additionalProperty("myPropertyName").isLike("myValue"); List<ICase> cases = ivy.wf.getCaseQueryExecutor().getResults(query, startIndex, count);
- Parameters:
propertyName
- the additional property name.propertyValue
- the additional property valuestartIndex
- the index of the first case of all cases found returned. Must be >= 0.count
- how many cases found are returned. Must be >= 0 or -1 which means return 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 all founded cases- Throws:
PersistencyException
- if persistency access fails- See Also:
- API:
- This public API is available in Java.
- Security:
- SESSION OWNS CaseReadAll PERMISSION OR OWNS CaseReadAll@SYSTEM PERMISSION
-
findCases
IQueryResult<ICase> findCases(IPropertyFilter<CaseProperty> filter, List<PropertyOrder<CaseProperty>> order, int startIndex, int count, boolean returnAllCount) Find cases using a filter
The filter can be created with the method
createCasePropertyFilter(CaseProperty, RelationalOperator, Object)
.
The order can be created with the methodPropertyOrder.create(IProperty, OrderDirection)
.Example:
import ch.ivyteam.ivy.persistence.OrderDirection;
import ch.ivyteam.ivy.workflow.PropertyOrder;
import ch.ivyteam.ivy.workflow.IPropertyFilter;
import ch.ivyteam.ivy.persistence.IQueryResult;
import ch.ivyteam.ivy.workflow.CaseProperty;
import ch.ivyteam.logicalexpression.RelationalOperator;
// create order
List order = PropertyOrder.create(CaseProperty.PROCESS_CODE, CaseProperty.PROCESS_CATEGORY_CODE);
// create filter
IPropertyFilter filter = ivy.wf.createCasePropertyFilter(CaseProperty.PROCESS_CODE, RelationalOperator.EQUAL, "MY_PROCESS_CODE");
// execute query
IQueryResult result = ivy.wf.findCases(filter, order, 0, -1, true);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().processCode().isEqual("MY_PROCESS_CODE") .orderBy().processCode().processCategoryCode(); List<ICase> cases = ivy.wf.getCaseQueryExecutor().getResults(query, startIndex, count);
- Parameters:
filter
- a filter expression to filter the cases. Can be null.order
- specifies how to order the result. Can be null.startIndex
- the index of the first case of all cases found returned. Must be >= 0count
- how many cases found are returned. Must be >= 0 or -1 which means return all.returnAllCount
- if true the query result methodIQueryResult.getAllCount()
returns the overall cases that have been found, if false it returns -1- Returns:
- a
query result
of the founded cases - Throws:
PersistencyException
- if persistency access fails- See Also:
-
createCasePropertyFilter(CaseProperty, RelationalOperator, Object)
PropertyOrder.create(IProperty)
PropertyOrder.create(IProperty...)
PropertyOrder.create(IProperty, OrderDirection)
PropertyOrder.create(IProperty, OrderDirection, IProperty, OrderDirection)
PropertyOrder.create(IProperty, OrderDirection, IProperty, OrderDirection, IProperty, OrderDirection)
CaseQuery
getCaseQueryExecutor()
- API:
- This public API is available in Java.
- Security:
- SESSION OWNS CaseReadAll PERMISSION OR OWNS CaseReadAll@SYSTEM PERMISSION
-
getRunningCasesCount
Gets the number of running cases of a process model version.
A case is running if it is in state
CaseState.CREATED
orCaseState.RUNNING
.- Parameters:
processModelVersion
- the process model version to check- Returns:
- The number of running cases in the specified PMV
- Throws:
PersistencyException
- if persistency access fails- API:
- This public API is available in Java.
-
getRunningCasesCount
Gets the number of running cases of a application.
A case is running if it is in state
CaseState.CREATED
orCaseState.RUNNING
.- Parameters:
app
- the app to check- Returns:
- The number of running cases in the specified app
- Throws:
PersistencyException
- if persistency access fails- API:
- This public API is available in Java.
-
findTask
Finds a task by its ID.- Parameters:
taskId
- the identifier of the task- Returns:
- the task or null if no task is found
- Throws:
PersistencyException
- if persistency access fails- API:
- This public API is available in Java.
- Security:
- SESSION OWNS TaskRead PERMISSION OR OWNS TaskRead@SYSTEM PERMISSION
-
findTask
Finds a task by its UUID.- Parameters:
uuid
- the uuid of the task- Returns:
- the task or null if no task is found
- API:
- This public API is available in Java.
-
findTasks
@Deprecated(since="7.3", forRemoval=true) IQueryResult<ITask> findTasks(String propertyName, String propertyValue, int startIndex, int count, boolean returnAllCount) Deprecated, for removal: This API element is subject to removal in a future version.use
insteadTaskQuery
.create().where().customField()
.textField(propertyName)
.isLike(propertyValue).executor().results(startIndex, count)Finds all tasks which have an additional property with the given name and value.
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().additionalProperty("myPropertyName").isLike("myValue"); List<ITask> tasks = ivy.wf.getTaskQueryExecutor().getResults(query, startIndex, count);
- Parameters:
propertyName
- the additional property namepropertyValue
- the additional property value.startIndex
- the index of the first task of all tasks found returned. Must be >= 0.count
- how many tasks found are returned. Must be >= 0 or -1 which means 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 all found tasks- Throws:
PersistencyException
- if persistency access fails- See Also:
- API:
- This public API is available in Java.
- Security:
- SESSION OWNS TaskReadAll PERMISSION OR OWNS TaskReadAll@SYSTEM PERMISSION
-
findTasks
IQueryResult<ITask> findTasks(IPropertyFilter<TaskProperty> filter, List<PropertyOrder<TaskProperty>> order, int startIndex, int count, boolean returnAllCount) Find tasks using a filter.
The filter can be created with the method
createTaskPropertyFilter(TaskProperty, RelationalOperator, Object)
.
The order can be created with the methodPropertyOrder.create(IProperty, OrderDirection)
.Example:
import ch.ivyteam.ivy.persistence.OrderDirection;
import ch.ivyteam.ivy.workflow.PropertyOrder;
import ch.ivyteam.ivy.workflow.IPropertyFilter;
import ch.ivyteam.ivy.persistence.IQueryResult;
import ch.ivyteam.ivy.workflow.TaskProperty;
import ch.ivyteam.logicalexpression.RelationalOperator;
// create order
List order = PropertyOrder.create(TaskProperty.TYPE_CODE, TaskProperty.SUB_TYPE_CODE);
// create filter
IPropertyFilter filter = ivy.wf.createTaskPropertyFilter(TaskProperty.TYPE_CODE, RelationalOperator.EQUAL, "MY_TYPE_CODE");
// execute query
IQueryResult result = ivy.wf.findTasks(filter, order, 0, -1, true);
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().typeCode().isEqual("MY_TYPE_CODE") .orderBy().typeCode().subTypeCode(); List<ITask> tasks = ivy.wf.getTaskQueryExecutor().getResults(query, startIndex, count);
- Parameters:
filter
- a filter expression to filter the tasks. Can be null.order
- how to order the result. Can be null.startIndex
- the index of the first task of all tasks found returned. Must be >= 0.count
- how many tasks found are returned. Must be >= 0 or -1 which means all.returnAllCount
- if true the query result methodIQueryResult.getAllCount()
returns the overall cases that have been found, if false it returns -1- Returns:
- a
query result
with the found tasks - Throws:
PersistencyException
- if persistency access fails- See Also:
-
createTaskPropertyFilter(TaskProperty, RelationalOperator, Object)
PropertyOrder.create(IProperty)
PropertyOrder.create(IProperty...)
PropertyOrder.create(IProperty, OrderDirection)
PropertyOrder.create(IProperty, OrderDirection, IProperty, OrderDirection)
PropertyOrder.create(IProperty, OrderDirection, IProperty, OrderDirection, IProperty, OrderDirection)
TaskQuery
getTaskQueryExecutor()
- API:
- This public API is available in Java.
- Security:
- SESSION OWNS TaskReadAll PERMISSION OR OWNS TaskReadAll@SYSTEM PERMISSION
-
findWorkTasks
Finds tasks that a given user can work on (currently working or can start).
Note: if parameter
count
is specified, then this method does not provide the whole number of matching tasks onIQueryResult.getAllCount()
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().canWorkOn(user); List<ITask> tasks = ivy.wf.getTaskQueryExecutor().getResults(query, startIndex, count);
- Parameters:
user
- an ivy userstartIndex
- index of the first result that is returned (0..n, first entry is 0)count
- maximum number of results to return (-1 for all)- Returns:
- tasks that a user can work on (never null)
- Throws:
PersistencyException
- if persistency access fails- See Also:
- API:
- This public API is available in Java.
- Security:
- SESSION OWNS TaskReadAll PERMISSION OR OWNS TaskReadAll@SYSTEM PERMISSION
-
findWorkTasks
IQueryResult<ITask> findWorkTasks(IUser user, IPropertyFilter<TaskProperty> filter, List<PropertyOrder<TaskProperty>> order, int startIndex, int count, boolean returnAllCount, EnumSet<TaskState> includeTaskStates) Finds tasks that a given user can work on (currently working or can start).
Task filter can be created with the method
createTaskPropertyFilter(TaskProperty, RelationalOperator, Object)
.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().canWorkOn(user) .and().state().isEqual(TaskState.SUSPENDED);; List<ITask> tasks = ivy.wf.getTaskQueryExecutor().getResults(query, startIndex, count);
- Parameters:
user
- an ivy userfilter
- additional filter for tasks (can be null)order
- sorting order for results (ORDER BY)startIndex
- index of the first result that is returned (0..n, first entry is 0)count
- maximum number of results to returnreturnAllCount
- whether the overall result counter should be returned (consider performance effects), seeIQueryResult.getAllCount()
includeTaskStates
- only tasks with listed states will be included in result (cannot be null).- Returns:
- tasks that a user can work on (never null)
- Throws:
PersistencyException
- if persistency access fails- See Also:
- API:
- This public API is available in Java.
- Security:
- SESSION OWNS TaskReadAll PERMISSION OR OWNS TaskReadAll@SYSTEM PERMISSION
-
findWorkflowEvents
IQueryResult<IWorkflowEvent> findWorkflowEvents(IPropertyFilter<WorkflowEventProperty> filter, List<PropertyOrder<WorkflowEventProperty>> order, int startIndex, int count, boolean returnAllCount) Finds workflow events.
The filter can be created with the method
createWorkflowEventPropertyFilter(WorkflowEventProperty, RelationalOperator, Object)
.- Parameters:
filter
- Filter criteria to specify which workflow events should be read. Can be null.order
- how to order the result. Can be null.startIndex
- the index of the first task of all tasks found returned. Must be >= 0.count
- maximum number of workflow events to be returned. Must be >= 0 or -1 to return all.returnAllCount
- if true the query result methodIQueryResult.getAllCount()
returns the overall cases that have been found, if false it returns -1- Returns:
- a
query result
with the found workflow events - Throws:
PersistencyException
- if persistency access fails- API:
- This public API is available in Java.
- Security:
- SESSION OWNS WorkflowEventReadAll PERMISSION OR OWNS WorkflowEventReadAll@SYSTEM PERMISSION
-
findIntermediateEvents
IQueryResult<IIntermediateEvent> findIntermediateEvents(IPropertyFilter<IntermediateEventProperty> filter, List<PropertyOrder<IntermediateEventProperty>> order, int startIndex, int count, boolean returnAllCount) Finds intermediate events
The filter can be created with the method
createIntermediateEventPropertyFilter(IntermediateEventProperty, RelationalOperator, Object)
.- Parameters:
filter
- Filter criteria to specify which intermediate events should be read. Can be null.order
- how to order the result. Can be null.startIndex
- the index of the first intermediate event of all intermediate events found returned. Must be >= 0.count
- how many intermediate events found are returned. Must be >= 0 or -1 which means allreturnAllCount
- if true the query result methodIQueryResult.getAllCount()
returns the overall intermediate events that have been found, if false it returns -1- Returns:
- a
query result
with the found intermediate events - Throws:
PersistencyException
- if persistency access fails- API:
- This public API is available in Java.
- Security:
- SESSION OWNS IntermediateEventReadAll PERMISSION OR OWNS IntermediateEventReadAll@SYSTEM PERMISSION
-
deleteCompletedCase
Deletes the given completed case and all belonging objects (tasks, workflow events, notes, process data etc.).
A completed case is a case that has the state
CaseState.DESTROYED
orCaseState.DONE
.This method can be used to clean up the database.
Warning: This method deletes the data of the given case permanently. It is not possible to restore the data afterwards.
- Parameters:
completedCase
- the case to delete permanently. Must not be null- Throws:
PersistencyException
- if persistency access failsIllegalStateException
- if the given case is not in stateCaseState.DESTROYED
orCaseState.DONE
- API:
- This public API is available in Java.
- Security:
- SESSION OWNS CaseDelete PERMISSION OR OWNS CaseDelete@SYSTEM PERMISSION
-
getWorkflowSession
Gets the workflow session that belongs to the given security session. The security session and the workflow session are two interfaces to the same object. With this method you can navigate from one interface to the other.
- Parameters:
session
- the security session- Returns:
- the workflow session that belongs to the given security session
- Throws:
PersistencyException
- if persistency access fails- API:
- This public API is available in Java.
-
findTaskCategories
@Deprecated(since="7.0", forRemoval=true) List<IGroup<ITask>> findTaskCategories(IPropertyFilter<TaskProperty> categoryFilter, TaskProperty categoryProperty, OrderDirection categoryPropertyOrder) Deprecated, for removal: This API element is subject to removal in a future version.useCategoryTree.createFor(TaskQuery)
insteadTasks can be categorized in a tree structure using the following task properties from top to bottom
TaskProperty.PROCESS_CATEGORY_CODE
,TaskProperty.PROCESS_CODE
,TaskProperty.TYPE_CODE
,TaskProperty.SUB_TYPE_CODE
,TaskProperty.KIND_CODE
.This method can be used to find the children of a node in the categorized tree structure. The top level tree nodes can be found using
TaskProperty.PROCESS_CATEGORY_CODE
as categoryProperty and null as categoryFilter. Children of a top level node can be found using the categoryFilter specifying the value of theTaskProperty.PROCESS_CATEGORY_CODE
of the node andTaskProperty.PROCESS_CODE
as categoryFilter. And so on until you are on the button of the tree usingTaskProperty.KIND_CODE
as categoryProperty. You may now use the methodfindTasks(IPropertyFilter, List, int, int, boolean)
to find all tasks that belong to the bottom groupEach category found is returned as a group. A group knows the number of objects contained in the group. Moreover, one example object of the group that represents all the entries in this group. It can be used to evaluate the category value of this group.
Consider to use the
TaskQuery
API alternatively. This fluent API makes the statement combinable with other filters and allows SQL-like value comparisons and grouping. E.g:TaskQuery query = TaskQuery.create() .where().processCategoryCode().isEqual("MY_CATEGORY_CODE") .groupBy().processCode() .aggregate().countRows(); Recordset rs = ivy.wf.getTaskQueryExecutor().getRecordset(query);
- Parameters:
categoryFilter
- filters the categories. Can be null.categoryProperty
- a task property that is used to build the categories (E.g. one ofTaskProperty.PROCESS_CATEGORY_CODE
,TaskProperty.PROCESS_CODE
,TaskProperty.TYPE_CODE
,TaskProperty.SUB_TYPE_CODE
,TaskProperty.KIND_CODE
)categoryPropertyOrder
- the order in which the categoryProperty should be ordered in. Can be null.- Returns:
- a list of the found
task categories
. - Throws:
PersistencyException
- if persistency access fails- See Also:
- API:
- This public API is available in Java.
- Security:
- SESSION OWNS TaskCategoryReadAll PERMISSION OR OWNS TaskCategoryReadAll@SYSTEM PERMISSION
-
findCaseCategories
@Deprecated(since="7.0", forRemoval=true) List<IGroup<ICase>> findCaseCategories(IPropertyFilter<CaseProperty> categoryFilter, CaseProperty categoryProperty, OrderDirection categoryPropertyOrder) Deprecated, for removal: This API element is subject to removal in a future version.useCategoryTree.createFor(CaseQuery)
insteadCases can be categorized in a tree structure using the following case properties from top to bottom
CaseProperty.PROCESS_CATEGORY_CODE
,CaseProperty.PROCESS_CODE
,CaseProperty.TYPE_CODE
,CaseProperty.SUB_TYPE_CODE
.This method can be used to find the children of a node in the categorized tree structure. The top level tree nodes can be found using
CaseProperty.PROCESS_CATEGORY_CODE
as categoryProperty and null as categoryFilter. Children of a top level node can be found using the categoryFilter specifying the value of theCaseProperty.PROCESS_CATEGORY_CODE
of the node andCaseProperty.PROCESS_CODE
as categoryFilter. And so on until you are on the button of the tree usingCaseProperty.SUB_TYPE_CODE
as categoryProperty. You may now use the methodfindCases(IPropertyFilter, List, int, int, boolean)
to find all cases that belong to the bottom groupEach category found is returned as a group. A group knows the number of objects contained in the group. Moreover, one example object of the group that represents all the entries in this group. It can be used to evaluate the category value of this group.
Consider to use the
CaseQuery
API alternatively. This fluent API makes the statement combinable with other filters and allows SQL-like value comparisons and grouping. E.g:CaseQuery query = CaseQuery.create() .where().processCategoryCode().isEqual("MY_CATEGORY_CODE") .groupBy().processCode() .aggregate().countRows(); Recordset rs = ivy.wf.getCaseQueryExecutor().getRecordset(query);
- Parameters:
categoryFilter
- filters the categories. Can be null.categoryProperty
- a case property that is used to build the categories (E.g. one ofCaseProperty.PROCESS_CATEGORY_CODE
,CaseProperty.PROCESS_CODE
,CaseProperty.TYPE_CODE
,CaseProperty.SUB_TYPE_CODE
})categoryPropertyOrder
- the order in which categoryProperty should be ordered in. Can be null.- Returns:
- a list of the found
case categories
. - Throws:
PersistencyException
- if persistency access fails- See Also:
- API:
- This public API is available in Java.
- Security:
- SESSION OWNS CaseCategoryReadAll PERMISSION OR OWNS CaseCategoryReadAll@SYSTEM PERMISSION
-
fireIntermediateEvent
IIntermediateEvent fireIntermediateEvent(IIntermediateEventElement intermediateEventElement, String eventIdentifier, Object resultObject, String additionalInformation) Fires an intermediate event.- Parameters:
intermediateEventElement
- the intermediate event element to fire the intermediate event on.eventIdentifier
- the event identifier.resultObject
- the result object. Can be null.additionalInformation
- additional information about the event.- Returns:
- the intermediate event
- Throws:
PersistencyException
- if persistency access fails- API:
- This public API is available in Java.
- Security:
- SESSION IS SYSTEM
-
getTaskQueryExecutor
ITaskQueryExecutor getTaskQueryExecutor()Executor fortask queries
on this workflow context.- Returns:
- task query executor
- See Also:
- API:
- This public API is available in Java.
- Security:
- SESSION OWNS TaskReadAll PERMISSION OR OWNS TaskReadAll@SYSTEM PERMISSION
-
getCaseQueryExecutor
ICaseQueryExecutor getCaseQueryExecutor()Executor forcase queries
on this workflow context.- Returns:
- case query executor
- See Also:
- API:
- This public API is available in Java.
- Security:
- SESSION OWNS CaseReadAll PERMISSION OR OWNS CaseReadAll@SYSTEM PERMISSION
-
getGlobalContext
IGlobalWorkflowContext getGlobalContext()- Returns:
- the global context
- See Also:
- API:
- This public API is available in Java.
-
findProcessStartsBySignature
Finds all process starts that have the given signature. Note that the signature is only unique for one process file, there may be multiple process starts with the same signature per process model version.- Parameters:
signature
- the signature of the searched process, i.e. mySignature(java.lang.String):java.lang.Integer- Returns:
- all process starts in released process model versions of all applications that uses this workflow context that match the given signature
- API:
- This public API is available in Java.
-
getStartableProcessStarts
Returns all process start elements which the given user can start.- Parameters:
user
-- Returns:
- process starts
- Since:
- 6.6.2
- API:
- This public API is available in Java.
-
getStartables
Returns all startables which the given user can start.- Parameters:
user
-- Returns:
- startables
- Since:
- 6.6.2
- API:
- This public API is available in Java.
-
findStartable
Returns an optional startable for the given id.- 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.
-
findStartable
Returns an optional startable for the given id that the user can start.- Parameters:
user
-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.
-
documents
IDocumentService documents()Returns a service for managing documents of this workflow context.Examples:
Add a document:
IDocument document = ivy.wf.documents().add(new Path("images/myImage.png")).write().withContentFrom(in.file);
Get all documents:
List<IDocument> documents = ivy.wf.documents().getAll();
- Returns:
- workflow context document service
- API:
- This public API is available in Java.
-
signals
IBpmSignalService signals()A service for sending and querying signals.
Example: send a signal:ivy.wf.signals().send("user:created");
- Returns:
- signal service
- Since:
- 6.1.0
- API:
- This public API is available in Java.
-
current
Gets the current workflow context.
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 context or null if out of scope
- Since:
- 9.1
- API:
- This public API is available in Java.
-
CategoryTree.createFor(CaseQuery)
instead