Interface ITask

    • Method Detail

      • 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.
        Security:
        SESSION OWNS ApplicationRead PERMISSION OR OWNS ApplicationRead@SYSTEM PERMISSION
      • 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.
        Security:
        SESSION OWNS ProcessModelRead PERMISSION OR OWNS ProcessModelRead@SYSTEM PERMISSION
      • 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.
        Security:
        SESSION OWNS ProcessModelVersionRead PERMISSION OR OWNS ProcessModelVersionRead@SYSTEM PERMISSION
      • 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.
        Security:
        SESSION OWNS TaskStartRead PERMISSION OR OWNS TaskStartRead@SYSTEM PERMISSION
      • 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.
        Security:
        SESSION OWNS TaskEndRead PERMISSION OR OWNS TaskEndRead@SYSTEM PERMISSION
      • 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 or TaskState.UNASSIGNED 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:
        activator(), getActivatorName(), setActivator(ISecurityMember)
        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
      • 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:
        activator(), getActivator(), setActivator(ISecurityMember)
        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. If the task is expired it sets the expiry activator. If it is not expire it sets the original activator
        Parameters:
        activator - the new activator
        See Also:
        activator(), getActivator(), getActivatorName()
        API:
        This public API is available in IvyScript and Java. It has the visibility EXPERT.
      • 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:
        originalActivator(), setOriginalActivator(ISecurityMember), getOriginalActivatorName()
        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:
        originalActivator(), getOriginalActivator(), setOriginalActivator(ISecurityMember)
        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:
        originalActivator(), getOriginalActivator(), getOriginalActivatorName()
        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
      • 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:
        expiryActivator(), setExpiryActivator(ISecurityMember), getExpiryActivatorName()
        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:
        expiryActivator(), getExpiryActivator(), getExpiryActivatorName()
        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:
        expiryActivator(), getExpiryActivator(), setExpiryActivator(ISecurityMember)
        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
      • 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
      • 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
        Returns:
        name of the task
        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 name)
        Sets the name of the task
        Parameters:
        name - the new name of the task
        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
      • getDisplayNameTemplate

        String getDisplayNameTemplate()
        Gets the display name template of the task
        Returns:
        name template
        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
        Returns:
        description of the task
        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 description)
        Sets the description of the task
        Parameters:
        description - the new name of the task
        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
      • getDisplayDescriptionTemplate

        String getDisplayDescriptionTemplate()
        Gets the display description template of the task
        Returns:
        description template of the task
        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:
        getCategoryPath(), getCategory(), Category
        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:
        setCategoryPath(String), getCategory(), Category
        API:
        This public API is available in IvyScript and Java. It has the visibility ADVANCED.
        Security:
        SESSION OWNS TaskReadCategory PERMISSION OR OWNS TaskReadCategory@SYSTEM PERMISSION
      • 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:
        setCategoryPath(String), getCategoryPath(), Category
        API:
        This public API is available in IvyScript and Java. It has the visibility ADVANCED.
        Security:
        SESSION OWNS TaskReadCategory PERMISSION OR OWNS TaskReadCategory@SYSTEM PERMISSION
      • 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:
        TaskQuery.IFilterableColumns.customField()
        API:
        This public API is available in IvyScript and Java. It has the visibility NOVICE.
      • getPageArchives

        List<IPageArchive> getPageArchives()
        Gets all page archives associated with this tasks
        Returns:
        A list of IPageArchive
        API:
        This public API is available in IvyScript and Java. It has the visibility ADVANCED.
        Security:
        SESSION OWNS TaskPageArchiveReadAll PERMISSION OR OWNS TaskPageArchiveReadAll@SYSTEM PERMISSION
      • getPageArchive

        IPageArchive getPageArchive​(long pageArchiveIdentifier)
        Find a page archive with its identifier
        Parameters:
        pageArchiveIdentifier - the identifier of the page archive
        Returns:
        the IPageArchive archive or null
        API:
        This public API is available in IvyScript and Java. It has the visibility ADVANCED.
        Security:
        SESSION OWNS TaskPageArchiveReadAll PERMISSION OR OWNS TaskPageArchiveReadAll@SYSTEM PERMISSION
      • 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
      • 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.