Interface ITask
- All Superinterfaces:
IAdditionalPropertyable
,INoteable
,ch.ivyteam.ivy.workflow.IPropertyValueSource<TaskProperty>
- Since:
- 17.05.2006
- API:
- This is a public API.
-
Method Summary
Modifier and TypeMethodDescriptionAccess to the activator.static ITask
current()
Gets the current task.You can use custom fields to store additional, customer specific information on a task.Get the localized descriptions of the task.void
destroy()
Destroys this taskAccess to the expiry activatorGets the task activator.Gets the name of the task activator (seegetActivator()
for more details).Deprecated.Gets the application the case belongs toGets theBusinessDuration
between the creation (seegetStartTimestamp()
) and the completion (seegetEndTimestamp()
) of this task.getCase()
Gets the case this task belongs toReturns the category path of thisITask
.Get the delay timestamp of the task.Get description of the task for the current session's content locale.Deprecated, for removal: This API element is subject to removal in a future version.will always return empty string.Deprecated, for removal: This API element is subject to removal in a future version.will always return empty string.getEnd()
Gets the task end this task has ended on.Gets the process data (in-object) at the end of the task-process or null, if task was not ended.Gets the task switch event on which this task has ended.Gets the end timestamp of the task or null if task is not yet finishedGets the task that created this task because it has expired.Calculates the business time until the task expires (BusinessDuration
between now andexpiryTimestamp
).Gets the task expiry activator.Gets the task activator.Gets the expiry priority of the taskGets the pid of the start element where a task should be started if this task expires.Gets the timestamp when this task expires.Returns the fail reason when the task state isTaskState.FAILED
,TaskState.JOIN_FAILED
and this state was caused by a failure.Get the full request path of the task inclusive application name and process model version namelong
getId()
Gets the identifier of this taskGets the intermediate event this task is waiting for or had been waited forgetName()
Get name of the task for the current session's content locale.Returns how many times the tasks has ben resumed by any user (task state changes toTaskState.RESUMED
).Gets the original task activator.Gets the original task activator.Gets the original priority of the taskGets the priority of the taskGets the process model the case belongs toGets the process model version the case was started inGets the request path of this taskgetStart()
Gets the task start this task was started onGets the start link of this task.Gets the start link of this task to embed in frame.Gets the process data (in-object) at the start of the task-process or null, if it is the initial task.Gets the task switch event this task was started.Gets the start timestamp of the taskgetState()
Gets the state of this taskGets the worker session of this task.Gets the user who has worked or is working on this task.Gets the name of the user who has worked or is working on this task.Gets the workflow context this case belongs toGets the workflow events of this taskGets theDuration
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 fromTaskState.CREATED
orTaskState.RESUMED
toTaskState.DONE
orTaskState.JOINING
).
When task gets parked or completed the elapsed time is saved.boolean
Is this task expired?boolean
Is this task a task that was created because an other task had expired?boolean
Checks if a task is persistent.Gets the locations of the task.names()
Get the localized names of the task.Access to the original activatorvoid
reset()
Resets this task to the task start.void
setActivator
(ISecurityMember activator) Sets the activator of the task.void
setBusinessCalendar
(IBusinessCalendar calendar) Defines theIBusinessCalendar
for thisITask
.void
setCategoryPath
(String categoryPath) Sets the given String as category path of thisITask
.void
setDelayTimestamp
(Date newDelayTimestamp) Sets the delay timestamp of the task.void
setDescription
(String descriptionTemplate) Expands the macros in the given task description template and then sets the expanded task description for eachlocale
.void
setExpiryActivator
(ISecurityMember expiryActivator) Sets the expiry activator of the task.void
setExpiryPriority
(WorkflowPriority expiryPriority) Sets the expiry priority of the taskvoid
setExpiryTimestamp
(Date newExpiryTimestamp) Sets the expiry timestamp of the task.void
Expands the macros in the given task name template and then sets the expanded task name for eachlocale
.void
setOriginalActivator
(ISecurityMember activator) Sets the original activator of the taskvoid
setOriginalPriority
(WorkflowPriority originalPriority) Sets the original priority of the taskMethods inherited from interface ch.ivyteam.ivy.workflow.INoteable
createNote, deleteNote, getNotes, hasNotes
-
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 (SeeisExpiryTask()
.- 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 isTaskState.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
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
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 methodgetActivatorName()
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 (seegetActivator()
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.useactivator()
.userCandidatesPaged()
insteadWARNING: 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
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 methodgetOriginalActivatorName()
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
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 methodgetExpiryActivatorName()
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
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
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 andexpiryTimestamp
). The duration calculation is done by theIBusinessCalendar
which is set on the task.- Returns:
- The calculated business duration until the task expires
or
null
if theexpiryTimestamp
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 stateTaskState.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
Sets the delay timestamp of the task. The delay timestamp can be set to null to immediately switch the task out of stateTaskState.DELAYED
.
This method has only effect if the task is currently in stateTaskState.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 methodgetWorkerUserName()
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 stateTaskState.RESUMED
orTaskState.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 (seegetStartTimestamp()
) and the completion (seegetEndTimestamp()
) of this task.The business runtime is calculated only when a task ends (state changes to
TaskState.DONE
orTaskState.JOINING
).To calculate the
BusinessDuration
theIDefaultBusinessCalendar
of the task is used.- Returns:
BusinessDuration
between creation and completion. Returnsnull
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 theDuration
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 fromTaskState.CREATED
orTaskState.RESUMED
toTaskState.DONE
orTaskState.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 tonull
). 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
.
Returnsnull
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
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
ILocalizedStrings 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, for removal: This API element is subject to removal in a future version.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
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, for removal: This API element is subject to removal in a future version.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
Sets the given String as category path of thisITask
. Use "/" as path separator.null
or an empty string could be used to reset the category path.- Parameters:
categoryPath
- the category path of thisITask
.- 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 thisITask
.The method
getCategory()
returns the correspondingCategory
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 theCategory
of thisITask
. TheCategory
provides locale specific information like the name or the description of a category path, as defined in the CMS. SeeCategory
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, nevernull
- 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 stateTaskState.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 toTaskState.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
Defines theIBusinessCalendar
for thisITask
. This influences theIDefaultBusinessCalendar
determination when callingivy.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
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.
-
activator()
.userCandidatesPaged()
instead