Interface ITask

All Superinterfaces:
IAdditionalPropertyable, INoteable, ch.ivyteam.ivy.workflow.IPropertyValueSource<TaskProperty>

public interface ITask extends INoteable, IAdditionalPropertyable, ch.ivyteam.ivy.workflow.IPropertyValueSource<TaskProperty>
A task is a work unit in a process that is worked by a single user
Since:
17.05.2006
API:
This is a public API.
  • Method Details

    • getApplication

      IApplication getApplication()
      Gets the application the case belongs to
      Returns:
      application
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
    • getWorkflowContext

      IWorkflowContext getWorkflowContext()
      Gets the workflow context this case belongs to
      Returns:
      workflow context
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
    • getProcessModel

      IProcessModel getProcessModel()
      Gets the process model the case belongs to
      Returns:
      process model
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
    • getProcessModelVersion

      IWorkflowProcessModelVersion getProcessModelVersion()
      Gets the process model version the case was started in
      Returns:
      process model version
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
    • getCase

      ICase getCase()
      Gets the case this task belongs to
      Returns:
      case
      API:
      This public API is available in IvyScript and Java. It has the visibility NOVICE.
      Security:
      SESSION OWNS CaseReadOwnCaseOfTask PERMISSION OR OWNS CaseRead PERMISSION OR OWNS CaseRead@SYSTEM PERMISSION
    • getStartSwitchEvent

      ITaskSwitchEvent getStartSwitchEvent()
      Gets the task switch event this task was started.
      Returns:
      start task switch
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
      Security:
      SESSION OWNS TaskSwitchEventRead PERMISSION OR OWNS TaskSwitchEventRead@SYSTEM PERMISSION
    • getStart

      ITaskStart getStart()
      Gets the task start this task was started on
      Returns:
      task start
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
    • getEndSwitchEvent

      ITaskSwitchEvent getEndSwitchEvent()
      Gets the task switch event on which this task has ended. Returns null if task is not yet finished
      Returns:
      end task switch or null.
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
      Security:
      SESSION OWNS TaskSwitchEventRead PERMISSION OR OWNS TaskSwitchEventRead@SYSTEM PERMISSION
    • getEnd

      ITaskEnd getEnd()
      Gets the task end this task has ended on. Returns null if task is not yet finished.
      Returns:
      task end or null.
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
    • getExpiredCreatorTask

      ITask getExpiredCreatorTask()
      Gets the task that created this task because it has expired. Returns null if this task in not an expiry task (See isExpiryTask().
      Returns:
      expired creator task or null
      API:
      This public API is available in IvyScript and Java. It has the visibility ADVANCED.
      Security:
      SESSION OWNS TaskReadOwnCaseTasks PERMISSION OR OWNS TaskRead PERMISSION OR OWNS TaskRead@SYSTEM PERMISSION
    • getId

      long getId()
      Gets the identifier of this task
      Returns:
      task identifier
      API:
      This public API is available in IvyScript and Java. It has the visibility ADVANCED.
    • getState

      TaskState getState()
      Gets the state of this task
      Returns:
      task state
      API:
      This public API is available in IvyScript and Java. It has the visibility ADVANCED.
      Security:
      SESSION OWNS TaskReadState PERMISSION OR OWNS TaskReadState@SYSTEM PERMISSION
    • getFailReason

      String getFailReason()
      Returns the fail reason when the task state is TaskState.FAILED, TaskState.JOIN_FAILED and this state was caused by a failure.
      Returns:
      Never null, in case of no failure an empty string is returned.
      API:
      This public API is available in IvyScript and Java. It has the visibility ADVANCED.
    • getPriority

      WorkflowPriority getPriority()
      Gets the priority of the task
      Returns:
      priority of the task
      API:
      This public API is available in IvyScript and Java. It has the visibility NOVICE.
      Security:
      SESSION OWNS TaskReadPriority PERMISSION OR OWNS TaskReadPriority@SYSTEM PERMISSION
    • getOriginalPriority

      WorkflowPriority getOriginalPriority()
      Gets the original priority of the task
      Returns:
      original priority of the task
      API:
      This public API is available in IvyScript and Java. It has the visibility NOVICE.
      Security:
      SESSION OWNS TaskReadOriginalPriority PERMISSION OR OWNS TaskReadOriginalPriority@SYSTEM PERMISSION
    • getExpiryPriority

      WorkflowPriority getExpiryPriority()
      Gets the expiry priority of the task
      Returns:
      expiry priority of the task
      API:
      This public API is available in IvyScript and Java. It has the visibility NOVICE.
      Security:
      SESSION OWNS TaskReadExpiryPriority PERMISSION OR OWNS TaskReadExpiryPriority@SYSTEM PERMISSION
    • setOriginalPriority

      void setOriginalPriority(WorkflowPriority originalPriority)
      Sets the original priority of the task
      Parameters:
      originalPriority - the new original priority
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
      Security:
      SESSION OWNS TaskWriteOriginalPriority PERMISSION OR OWNS TaskWriteOriginalPriority@SYSTEM PERMISSION
    • setExpiryPriority

      void setExpiryPriority(WorkflowPriority expiryPriority)
      Sets the expiry priority of the task
      Parameters:
      expiryPriority - the new expiry priority
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
      Security:
      SESSION OWNS TaskWriteExpiryPriority PERMISSION OR OWNS TaskWriteExpiryPriority@SYSTEM PERMISSION
    • getActivator

      ISecurityMember getActivator()
      Gets the task activator. An activator is a user or a role that can start the task.
      The task activator can be null if role or user has been already deleted since the task creation. You can evaluate the name of the task activator using the method getActivatorName() even if the task activator was deleted.
      This method returns the original task activator if the task is not expired or the "expired task activator" if the task is expired. The expired task activator is usually not the same user or role which is the original activator. This user or role is set when the task expires. Read more about this activator in the designer guide at task switch process element.
      Returns:
      task activator user or role (or null)
      See Also:
      API:
      This public API is available in IvyScript and Java. It has the visibility ADVANCED.
      Security:
      SESSION OWNS TaskReadActivator PERMISSION OR OWNS TaskReadActivator@SYSTEM PERMISSION
    • activator

      IActivator activator()
      Access to the activator. Activator is a user or a role that is responsible to execute the task.
      Returns:
      activator
      Since:
      8.0.3
      See Also:
      API:
      This public API is available in IvyScript and Java. It has the visibility ADVANCED.
    • getActivatorName

      String getActivatorName()
      Gets the name of the task activator (see getActivator() for more details). Never returns null even if the task activator was deleted. This method returns the original task activator name if the task is not expired or the expired task activator name if the task is expired.
      Returns:
      task activator name.
      See Also:
      API:
      This public API is available in IvyScript and Java. It has the visibility NOVICE.
      Security:
      SESSION OWNS TaskReadActivatorName PERMISSION OR OWNS TaskReadActivatorName@SYSTEM PERMISSION
    • getActivatorUserCandidates

      @Deprecated(since="8.0.3") List<IUser> getActivatorUserCandidates()
      Deprecated.

      WARNING: This methods loads the resulting users into memory.
      This can cause out of memory exceptions and bad performance depending on the number of users in your application.

      Returns:
      List of users that can activate this task
      API:
      This public API is available in IvyScript and Java. It has the visibility ADVANCED.
    • setActivator

      void setActivator(ISecurityMember activator)
      Sets the activator of the task. Expiry activator and original activator are not changed.
      Parameters:
      activator - the new activator
      See Also:
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
    • originalActivator

      IActivator originalActivator()
      Access to the original activator
      Returns:
      original activator
      Since:
      8.0.3
      See Also:
      API:
      This public API is available in IvyScript and Java. It has the visibility ADVANCED.
    • getOriginalActivator

      ISecurityMember getOriginalActivator()
      Gets the original task activator. Maybe null if task activator was deleted since the task was created. You can evaluate the name of the original task activator with the method getOriginalActivatorName() even if the original task activator was deleted.
      Returns:
      original task activator or null
      See Also:
      API:
      This public API is available in IvyScript and Java. It has the visibility ADVANCED.
      Security:
      SESSION OWNS TaskReadOriginalActivator PERMISSION OR OWNS TaskReadOriginalActivator@SYSTEM PERMISSION
    • getOriginalActivatorName

      String getOriginalActivatorName()
      Gets the original task activator. Never returns null even if the original task activator was deleted.
      Returns:
      original task activator name.
      See Also:
      API:
      This public API is available in IvyScript and Java. It has the visibility NOVICE.
      Security:
      SESSION OWNS TaskReadOriginalActivatorName PERMISSION OR OWNS TaskReadOriginalActivatorName@SYSTEM PERMISSION
    • setOriginalActivator

      void setOriginalActivator(ISecurityMember activator)
      Sets the original activator of the task
      Parameters:
      activator - the activator of the task
      See Also:
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
      Security:
      SESSION OWNS TaskWriteOriginalActivator PERMISSION OR OWNS TaskWriteOriginalActivator@SYSTEM PERMISSION
    • expiryActivator

      IActivator expiryActivator()
      Access to the expiry activator
      Returns:
      expiry activator
      Since:
      8.0.3
      See Also:
      API:
      This public API is available in IvyScript and Java. It has the visibility ADVANCED.
    • getExpiryActivator

      ISecurityMember getExpiryActivator()
      Gets the task expiry activator. Maybe null if no expiry activator was set or the expiry activator was deleted since the task was created. You can evaluate the name of the expiry activator with the method getExpiryActivatorName() even if the expiry activator was deleted.
      Returns:
      expiry activator or null
      See Also:
      API:
      This public API is available in IvyScript and Java. It has the visibility ADVANCED.
      Security:
      SESSION OWNS TaskReadExpiryActivator PERMISSION OR OWNS TaskReadExpiryActivator@SYSTEM PERMISSION
    • setExpiryActivator

      void setExpiryActivator(ISecurityMember expiryActivator)
      Sets the expiry activator of the task. This method has no effect if task is already expired.
      Parameters:
      expiryActivator - expiry activator
      See Also:
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
      Security:
      SESSION OWNS TaskWriteExpiryActivator PERMISSION OR OWNS TaskWriteExpiryActivator@SYSTEM PERMISSION
    • getExpiryActivatorName

      String getExpiryActivatorName()
      Gets the task activator. Maybe null if no expiry activator was set. Does not return null if an expiry activator was set even the expiry activator was deleted.
      Returns:
      task activator name or null.
      See Also:
      API:
      This public API is available in IvyScript and Java. It has the visibility NOVICE.
      Security:
      SESSION OWNS TaskReadExpiryActivatorName PERMISSION OR OWNS TaskReadExpiryActivatorName@SYSTEM PERMISSION
    • getExpiryTimestamp

      Date getExpiryTimestamp()
      Gets the timestamp when this task expires. Returns null if this task will not be expired.
      Returns:
      expiry timestamp or null.
      API:
      This public API is available in IvyScript and Java. It has the visibility NOVICE.
      Security:
      SESSION OWNS TaskReadExpiryTimestamp PERMISSION OR OWNS TaskReadExpiryTimestamp@SYSTEM PERMISSION
    • setExpiryTimestamp

      void setExpiryTimestamp(Date newExpiryTimestamp)
      Sets the expiry timestamp of the task. Can set to null if expiry of this task should be disabled. If new expiry timestamp is older than current time the task is expired immediately. This method has no effect if the task was already expired.

      If no expiry-activator is set, the task will be destroyed on expiry.

      Parameters:
      newExpiryTimestamp - the new expiry timestamp. Maybe null.
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
      Security:
      SESSION OWNS TaskWriteExpiryTimestamp PERMISSION OR OWNS TaskWriteExpiryTimestamp@SYSTEM PERMISSION
    • getExpiresInBusinessDuration

      BusinessDuration getExpiresInBusinessDuration()
      Calculates the business time until the task expires (BusinessDuration between now and expiryTimestamp). The duration calculation is done by the IBusinessCalendar which is set on the task.
      Returns:
      The calculated business duration until the task expires or null if the expiryTimestamp is not set.
      Since:
      Pilatus
      See Also:
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
    • isExpired

      boolean isExpired()
      Is this task expired?
      Returns:
      true if this task is expired, otherwise false
      API:
      This public API is available in IvyScript and Java. It has the visibility NOVICE.
      Security:
      SESSION OWNS TaskReadIsExpiry PERMISSION OR OWNS TaskReadIsExpiry@SYSTEM PERMISSION
    • isExpiryTask

      boolean isExpiryTask()
      Is this task a task that was created because an other task had expired?
      Returns:
      true if this task was created because an other task had expired, otherwise false
      API:
      This public API is available in IvyScript and Java. It has the visibility ADVANCED.
      Security:
      SESSION OWNS TaskReadIsExpiry PERMISSION OR OWNS TaskReadIsExpiry@SYSTEM PERMISSION
    • getExpiryTaskStartElementPid

      String getExpiryTaskStartElementPid()
      Gets the pid of the start element where a task should be started if this task expires. Returns null if no task should be started
      Returns:
      pid of the start element
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
      Security:
      SESSION OWNS TaskReadExpiryTaskStartElementPid PERMISSION OR OWNS TaskReadExpiryTaskStartElementPid@SYSTEM PERMISSION
    • getDelayTimestamp

      Date getDelayTimestamp()
      Get the delay timestamp of the task. Returns null if this task is or was not created in state TaskState.DELAYED.
      Returns:
      delay timestamp or null.
      API:
      This public API is available in IvyScript and Java. It has the visibility NOVICE.
      Security:
      SESSION OWNS TaskReadDelayTimestamp PERMISSION OR OWNS TaskReadDelayTimestamp@SYSTEM PERMISSION
    • setDelayTimestamp

      void setDelayTimestamp(Date newDelayTimestamp)
      Sets the delay timestamp of the task. The delay timestamp can be set to null to immediately switch the task out of state TaskState.DELAYED.
      This method has only effect if the task is currently in state TaskState.DELAYED.
      Parameters:
      newDelayTimestamp - the new delay timestamp. Maybe null
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
      Security:
      SESSION OWNS TaskWriteDelayTimestamp PERMISSION OR OWNS TaskWriteDelayTimestamp@SYSTEM PERMISSION
    • getWorkerUser

      IUser getWorkerUser()
      Gets the user who has worked or is working on this task. Return null if no user has worked on this task so far or if the user who has worked on this task was deleted. User method getWorkerUserName() to evaluate the name of the worker user even if the worker user was deleted.
      Returns:
      worker user or null.
      API:
      This public API is available in IvyScript and Java. It has the visibility ADVANCED.
      Security:
      SESSION OWNS TaskReadWorkerUser PERMISSION OR OWNS TaskReadWorkerUser@SYSTEM PERMISSION
    • getWorkerUserName

      String getWorkerUserName()
      Gets the name of the user who has worked or is working on this task. Returns null if no user has worked on this task so far.
      Returns:
      name of the worker user or null.
      API:
      This public API is available in IvyScript and Java. It has the visibility NOVICE.
      Security:
      SESSION OWNS TaskReadWorkerUserName PERMISSION OR OWNS TaskReadWorkerUserName@SYSTEM PERMISSION
    • getWorkerSession

      IWorkflowSession getWorkerSession()
      Gets the worker session of this task. The worker session is the session that is currently working on this task. This methods returns null if task is not in state TaskState.RESUMED or TaskState.CREATED.
      Returns:
      worker session or null
      API:
      This public API is available in IvyScript and Java. It has the visibility NOVICE.
      Security:
      SESSION OWNS TaskReadWorkerSession PERMISSION OR OWNS TaskReadWorkerSession@SYSTEM PERMISSION
    • getRequestPath

      String getRequestPath()
      Gets the request path of this task
      Returns:
      current request path
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
      Security:
      SESSION OWNS TaskReadRequestPath PERMISSION OR OWNS TaskReadRequestPath@SYSTEM PERMISSION
    • getFullRequestPath

      String getFullRequestPath()
      Get the full request path of the task inclusive application name and process model version name
      Returns:
      full request path
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
      Security:
      SESSION OWNS TaskReadRequestPath PERMISSION OR OWNS TaskReadRequestPath@SYSTEM PERMISSION
    • getStartTimestamp

      Date getStartTimestamp()
      Gets the start timestamp of the task
      Returns:
      start timestamp
      API:
      This public API is available in IvyScript and Java. It has the visibility NOVICE.
      Security:
      SESSION OWNS TaskReadStartTimestamp PERMISSION OR OWNS TaskReadStartTimestamp@SYSTEM PERMISSION
    • getEndTimestamp

      Date getEndTimestamp()
      Gets the end timestamp of the task or null if task is not yet finished
      Returns:
      end timestamp or null
      API:
      This public API is available in IvyScript and Java. It has the visibility NOVICE.
      Security:
      SESSION OWNS TaskReadEndTimestamp PERMISSION OR OWNS TaskReadEndTimestamp@SYSTEM PERMISSION
    • getBusinessRuntime

      BusinessDuration getBusinessRuntime()

      Gets the BusinessDuration between the creation (see getStartTimestamp()) and the completion (see getEndTimestamp()) of this task.

      The business runtime is calculated only when a task ends (state changes to TaskState.DONE or TaskState.JOINING).

      To calculate the BusinessDuration the IDefaultBusinessCalendar of the task is used.

      Returns:
      BusinessDuration between creation and completion. Returns null if the task is not yet completed or the task has been completed before the business runtime feature was introduced.
      See Also:
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
    • getWorkingTime

      Duration getWorkingTime()
      Gets the Duration during that any user has been working on this task.
      The working time is calculated from the time where the user starts working on this task till the task is completed (state changes from TaskState.CREATED or TaskState.RESUMED to TaskState.DONE or TaskState.JOINING).
      When task gets parked or completed the elapsed time is saved. While a task is parked, the working time will not be counted until the task is resumed again. When a task is reset, the calculated working time is deleted (set to null). E.g.
          created at 12:00 - parked at 12:10     => workingTime = 10 minutes
          resumed at 12:30 - completed at 12:40  => workingTime = 10 minutes
          ------------------------------------------------------------------
          Total                                     workingTime = 20 minutes
       
      Returns:
      Working time as Duration.
      Returns null for the following situations:
      • the task has never been parked or completed
      • the task has been reset
      • the task has been completed before the working time feature was introduced.
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
    • isPersistent

      boolean isPersistent()
      Checks if a task is persistent. A task that is persistent will also be available after a system restart. Tasks that are created on a task switch element are always persistent. The first task of a case is normally not persistent with the following exceptions:
      • The task has been joined on a task switch element
      • The case of the task was created with a trigger element
      • The task itself has triggered another case with a trigger element
      • A note or an additional attribute has been set on the task
      Returns:
      true if task is persistent, otherwise false
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
    • getIntermediateEvent

      IIntermediateEvent getIntermediateEvent()
      Gets the intermediate event this task is waiting for or had been waited for
      Returns:
      intermediate event or null if task is not waiting or has not waited for an intermediate event.
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
      Security:
      SESSION OWNS IntermediateEventRead PERMISSION OR OWNS IntermediateEventRead@SYSTEM PERMISSION
    • getName

      String getName()
      Get name of the task for the current session's content locale.
      Returns:
      name of the task
      See Also:
      API:
      This public API is available in IvyScript and Java. It has the visibility NOVICE.
      Security:
      SESSION OWNS TaskReadName PERMISSION OR OWNS TaskReadName@SYSTEM PERMISSION
    • setName

      void setName(String nameTemplate)

      Expands the macros in the given task name template and then sets the expanded task name for each locale.

      Note: Only <%=ivy.cms.co(...)%> macros are supported. If you want to include process data then use string concatenation instead of <%=in. ...%> macros.

      If the given task name template do not contain any macros the same task name (the name template) is set for all locales.

      Example:

      
       ivy.task.setName("<%=ivy.cms.co(\"/task/name\")%> " + in.person.name);
       
      Parameters:
      nameTemplate - the template with macros to expand
      Throws:
      IllegalArgumentException - if the given macro is null
      See Also:
      API:
      This public API is available in IvyScript and Java. It has the visibility ADVANCED.
      Security:
      SESSION OWNS TaskWriteName PERMISSION OR OWNS TaskWriteName@SYSTEM PERMISSION
    • names

      Get the localized names of the task.

      Example:

      String taskName = ivy.wfTask.names().current();
      Returns:
      localized names
      Since:
      9.4
      See Also:
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
    • getDisplayNameTemplate

      @Deprecated(since="9.4", forRemoval=true) String getDisplayNameTemplate()
      Deprecated, for removal: This API element is subject to removal in a future version.
      will always return empty string. Use getName() or names().get(Locale) instead.
      Gets the display name template of the task.
      Returns:
      empty string
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
      Security:
      SESSION OWNS TaskReadDisplayNameTemplate PERMISSION OR OWNS TaskReadDisplayNameTemplate@SYSTEM PERMISSION
    • getDescription

      String getDescription()
      Get description of the task for the current session's content locale.
      Returns:
      description of the task
      See Also:
      API:
      This public API is available in IvyScript and Java. It has the visibility NOVICE.
      Security:
      SESSION OWNS TaskReadDescription PERMISSION OR OWNS TaskReadDescription@SYSTEM PERMISSION
    • setDescription

      void setDescription(String descriptionTemplate)

      Expands the macros in the given task description template and then sets the expanded task description for each locale.

      Note: Only <%=ivy.cms.co(...)%> macros are supported. If you want to include process data then use string concatenation instead of <%=in. ...%> macros.

      If the given task description template do not contain any macros the same task description (the name template) is set for all locales.

      Example:

      
       ivy.task.setDescription("<%=ivy.cms.co(\"/task/description\")%> " + in.person.name);
       
      Parameters:
      descriptionTemplate - the template with macros to expand
      Throws:
      IllegalArgumentException - if the given macro is null
      See Also:
      API:
      This public API is available in IvyScript and Java. It has the visibility ADVANCED.
      Security:
      SESSION OWNS TaskWriteDescription PERMISSION OR OWNS TaskWriteDescription@SYSTEM PERMISSION
    • descriptions

      ILocalizedStrings descriptions()

      Get the localized descriptions of the task.

      Example:

      String taskDescription = ivy.wfTask.descriptions().current();
      Returns:
      localized descriptions
      Since:
      9.4
      See Also:
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
    • getDisplayDescriptionTemplate

      @Deprecated(since="9.4", forRemoval=true) String getDisplayDescriptionTemplate()
      Deprecated, for removal: This API element is subject to removal in a future version.
      will always return empty string. Use getDescription() or descriptions().get(Locale) instead.
      Gets the display description template of the task.
      Returns:
      empty string
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
      Security:
      SESSION OWNS TaskReadDisplayDescriptionTemplate PERMISSION OR OWNS TaskReadDisplayDescriptionTemplate@SYSTEM PERMISSION
    • setCategoryPath

      void setCategoryPath(String categoryPath)
      Sets the given String as category path of this ITask. Use "/" as path separator.

      null or an empty string could be used to reset the category path.

      Parameters:
      categoryPath - the category path of this ITask.
      See Also:
      API:
      This public API is available in IvyScript and Java. It has the visibility ADVANCED.
      Security:
      SESSION OWNS TaskWriteCategory PERMISSION OR OWNS TaskWriteCategory@SYSTEM PERMISSION
    • getCategoryPath

      String getCategoryPath()
      Returns the category path of this ITask.

      The method getCategory() returns the corresponding Category to the current set category path.

      Returns:
      the current category path, never null
      See Also:
      API:
      This public API is available in IvyScript and Java. It has the visibility ADVANCED.
    • getCategory

      Category getCategory()
      Returns the Category of this ITask. The Category provides locale specific information like the name or the description of a category path, as defined in the CMS. See Category for more information.

      The method setCategoryPath(String) allows to set the category of a task.

      Returns:
      the current Category, corresponding to the current category path, never null
      See Also:
      API:
      This public API is available in IvyScript and Java. It has the visibility ADVANCED.
    • customFields

      ICustomFields customFields()

      You can use custom fields to store additional, customer specific information on a task. You can use custom fields to search for or filter tasks.

      Examples:

      Setting a custom field:

      ivy.task.customFields().stringField("branchOffice").set("Zug");

      Getting a custom field:

      String branchOffice = ivy.task.customFields().stringField("branchOffice").getOrDefault("Luzern")

      Getting all custom fields:

      import ch.ivyteam.ivy.workflow.custom.field.ICustomField;
      List<ICustomField> customFields = ivy.task.customFields().all();
      Returns:
      custom fields
      Since:
      7.3
      See Also:
      API:
      This public API is available in IvyScript and Java. It has the visibility NOVICE.
    • getWorkflowEvents

      List<IWorkflowEvent> getWorkflowEvents()
      Gets the workflow events of this task
      Returns:
      list of workflow events
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
      Security:
      SESSION OWNS WorkflowEventReadAll PERMISSION OR OWNS WorkflowEventReadAll@SYSTEM PERMISSION
    • destroy

      void destroy()
      Destroys this task
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
      Security:
      SESSION OWNS TaskDestroy PERMISSION OR OWNS TaskDestroy@SYSTEM PERMISSION
    • reset

      void reset()

      Resets this task to the task start.

      This method can be called if the task is in one of the following states:

      After the method was called the task will be in the state TaskState.SUSPENDED.

      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
      Security:
      SESSION OWNS TaskReset PERMISSION OR OWNS TaskReset@SYSTEM PERMISSION
    • getStartProcessData

      CompositeObject getStartProcessData()
      Gets the process data (in-object) at the start of the task-process or null, if it is the initial task.
      Returns:
      the process data at the start of the process.
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
      Security:
      SESSION OWNS TaskReadProcessData PERMISSION OR OWNS TaskReadProcessData@SYSTEM PERMISSION
    • getEndProcessData

      CompositeObject getEndProcessData()
      Gets the process data (in-object) at the end of the task-process or null, if task was not ended.
      Returns:
      the process data at the end of the task-process or null, if task was not ended.
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
      Security:
      SESSION OWNS TaskReadProcessData PERMISSION OR OWNS TaskReadProcessData@SYSTEM PERMISSION
    • getNumberOfResumes

      Integer getNumberOfResumes()
      Returns how many times the tasks has ben resumed by any user (task state changes to TaskState.RESUMED). For the first task of a case the resume count is automatically set to one.
      Returns:
      Number of resumes or null if the task was completed before this feature was introduced.
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
    • setBusinessCalendar

      void setBusinessCalendar(IBusinessCalendar calendar)
      Defines the IBusinessCalendar for this ITask. This influences the IDefaultBusinessCalendar determination when calling ivy.cal.
      Parameters:
      calendar - may be null.
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
    • locations

      ILocationService locations()

      Gets the locations of the task.

      Example:

       import ch.ivyteam.ivy.location.ILocation;
       ILocation location = ivy.task.locations().getLatest();
       if (location != null)
       {
         ivy.log.info("Last known position somebody has worked on the task "+ivy.task.getId()+" was "+location.getPosition());
       }
      Returns:
      location service
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
    • getStartLink

      WebLink getStartLink()
      Gets the start link of this task.
      Returns:
      WebLink
      API:
      This public API is available in IvyScript and Java. It has the visibility NOVICE.
    • getStartLinkEmbedded

      WebLink getStartLinkEmbedded()
      Gets the start link of this task to embed in frame.
      Returns:
      WebLink
      API:
      This public API is available in IvyScript and Java. It has the visibility NOVICE.
    • current

      static ITask current()

      Gets the current task.

      Will return null if called out of scope. E.g. if no task is available in the current context

      Returns:
      current task or null if out of scope
      Since:
      9.1
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.