Interface IWorkflowContext


public interface IWorkflowContext
The workflow context gives you access to all tasks and cases of all users of an security context. There is a workflow context for each security context and vice versa. Multiple applications can share the same security context and therefore also the same workflow context.
Since:
17.05.2006
API:
This is a public API.
  • Method Details

    • getApplication

      @Deprecated(since="9.4", forRemoval=true) IApplication getApplication()
      Deprecated, for removal: This API element is subject to removal in a future version.
      use IApplication.current() to get the current application
      If 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 fails
      IllegalStateException - 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%"));
      IPropertyFilter filterPriority = ivy.wf.createCasePropertyFilter(CaseProperty.PRIORITY, RelationalOperator.EQUAL, WorkflowPriority.NORMAL.intValue());
      IPropertyFilter filter = filterName.and(filterPriority);

      Parameters:
      property - the case property to filter with
      operator - the filter operator
      value - 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%")
      IPropertyFilter filterPriority = ivy.wf.createTaskPropertyFilter(TaskProperty.PRIORITY, RelationalOperator.EQUAL, WorkflowPriority.NORMAL.intValue());
      IPropertyFilter filter = filterName.and(filterPriority);

      Parameters:
      property - the case property to filter with
      operator - the filter operator
      value - 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%"));
      IPropertyFilter filterCreateCase = ivy.wf.createWorkflowEventPropertyFilter(WorkflowEventProperty.EVENT_KIND, RelationalOperator.EQUAL, WorkflowEventKind.EVENT_CREATE_CASE.intValue());
      IPropertyFilter filter = filterUserName.and(filterCreateCase);

      Parameters:
      property - the case property to filter with
      operator - the filter operator
      value - 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 with
      operator - the filter operator
      value - 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

      ICase findCase(long caseIdentifier)
      Finds a case by its ID.
      Parameters:
      caseIdentifier - 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
    • 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 CaseQuery.create().where().customField().textField(propertyName).isLike(propertyValue).executor().results(startIndex, count) instead
      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 value
      startIndex - 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 method IQueryResult.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 method PropertyOrder.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 >= 0
      count - how many cases found are returned. Must be >= 0 or -1 which means return all.
      returnAllCount - if true the query result method IQueryResult.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:
      API:
      This public API is available in Java.
      Security:
      SESSION OWNS CaseReadAll PERMISSION OR OWNS CaseReadAll@SYSTEM PERMISSION
    • getRunningCasesCount

      int getRunningCasesCount(IProcessModelVersion processModelVersion)

      Gets the number of running cases of a process model version.

      A case is running if it is in state CaseState.CREATED or CaseState.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

      int getRunningCasesCount(IApplication app)

      Gets the number of running cases of a application.

      A case is running if it is in state CaseState.CREATED or CaseState.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

      ITask findTask(long taskIdentifier)
      Finds a task by its ID.
      Parameters:
      taskIdentifier - 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
    • 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 TaskQuery.create().where().customField().textField(propertyName).isLike(propertyValue).executor().results(startIndex, count) instead

      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 name
      propertyValue - 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 method IQueryResult.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 method PropertyOrder.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 method IQueryResult.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:
      API:
      This public API is available in Java.
      Security:
      SESSION OWNS TaskReadAll PERMISSION OR OWNS TaskReadAll@SYSTEM PERMISSION
    • findWorkTasks

      IQueryResult<ITask> findWorkTasks(IUser user, int startIndex, int count)

      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 on IQueryResult.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 user
      startIndex - 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 user
      filter - 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 return
      returnAllCount - whether the overall result counter should be returned (consider performance effects), see IQueryResult.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 method IQueryResult.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 all
      returnAllCount - if true the query result method IQueryResult.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

      void deleteCompletedCase(ICase completedCase)

      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 or CaseState.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 fails
      IllegalStateException - if the given case is not in state CaseState.DESTROYED or CaseState.DONE
      API:
      This public API is available in Java.
      Security:
      SESSION OWNS CaseDelete PERMISSION OR OWNS CaseDelete@SYSTEM PERMISSION
    • getWorkflowSession

      IWorkflowSession getWorkflowSession(ISession session)

      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.

      Tasks 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 the TaskProperty.PROCESS_CATEGORY_CODE of the node and TaskProperty.PROCESS_CODE as categoryFilter. And so on until you are on the button of the tree using TaskProperty.KIND_CODE as categoryProperty. You may now use the method findTasks(IPropertyFilter, List, int, int, boolean) to find all tasks that belong to the bottom group

      Each 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 of TaskProperty.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.

      Cases 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 the CaseProperty.PROCESS_CATEGORY_CODE of the node and CaseProperty.PROCESS_CODE as categoryFilter. And so on until you are on the button of the tree using CaseProperty.SUB_TYPE_CODE as categoryProperty. You may now use the method findCases(IPropertyFilter, List, int, int, boolean) to find all cases that belong to the bottom group

      Each 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 of CaseProperty.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 for task 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 for case 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

      Set<IProcessStart> findProcessStartsBySignature(String signature)
      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

      List<IProcessStart> getStartableProcessStarts(IUser user)
      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

      List<IWebStartable> getStartables(IUser user)
      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.
    • 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

      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

      static IWorkflowContext 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.