Interface ICase
-
- All Superinterfaces:
IAdditionalPropertyable
,INoteable
- All Known Subinterfaces:
IBusinessCase
public interface ICase extends INoteable, IAdditionalPropertyable
A workflow case is an instance of a process. It consists of multiple tasks.The system relevant fields of a case have certain functions within the system. Modifying them means to modify the behavior the case.
The business fields of a case can be used by the process designer to stored business information within a case. He is free in what kind of information he stores in the business fields. We suggest to use the business fields appropriate to their names. The information within the business fields can be referenced within name and description.
The custom fields of a case can be used by the process designer to stored custom information within a case. He is free in what kind of information he stores in the custom fields. The information within the custom fields can be referenced within name and description
- Since:
- 17.05.2006
- API:
- This is a public API.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description void
attachToBusinessCase(long businessCaseId)
Attaches this case to abusiness case
with the given id.ICustomFields
customFields()
You can use custom fields to store additional, customer specific information on a case.void
destroy()
Destroys this case and all tasks that belongs to the caseIDocumentService
documents()
Returns a service for managing documents that are attached to the case.String
getActiveEnvironment()
List<ITask>
getActiveTasks()
Gets all tasks in a active stateIApplication
getApplication()
Gets the application the case belongs toIBusinessCase
getBusinessCase()
Gets thebusiness case
this case belongs to.BusinessDuration
getBusinessRuntime()
Gets theBusinessDuration
between the creation (seegetStartTimestamp()
) and the completion (seegetEndTimestamp()
) of this case.Category
getCategory()
String
getCategoryPath()
Returns the category path of thisICase
.ITask
getCreatorTask()
Gets the task that created this case with a trigger element, maybe null if case was not started through a trigger element.IUser
getCreatorUser()
Gets the user who created this case.String
getCreatorUserName()
Gets the name of the user who created this case.String
getDescription()
Get description of the caseString
getDisplayDescriptionTemplate()
Gets the display description template of the caseString
getDisplayNameTemplate()
Gets the display name template of the caseDate
getEndTimestamp()
Gets the end timestamp of the case.ITask
getFirstTask()
Gets the first task of the case.long
getId()
Returns the case identifierString
getName()
Get name of the caseISecurityMember
getOwner()
Returns the owner of the case.String
getOwnerName()
Returns the name of the owner.List<IPageArchive>
getPageArchives()
Gets all page archives associated with this caseWorkflowPriority
getPriority()
Gets the priority of the caseIProcessModel
getProcessModel()
Gets the process model the case belongs toIWorkflowProcessModelVersion
getProcessModelVersion()
Gets the process model version the case was started inIProcessStart
getProcessStart()
Get the process start the case was started onDate
getStartTimestamp()
Gets the start timestamp of the caseCaseState
getState()
Get state of the caseList<ITask>
getTasks()
Gets all tasksIWorkflowContext
getWorkflowContext()
Gets the workflow context this case belongs toList<IWorkflowEvent>
getWorkflowEvents()
Gets the workflow events of this caseDuration
getWorkingTime()
Gets theDuration
during that any user has been working on this case.
The working time is the sum of the working times from all tasks of this case.boolean
isBusinessCase()
Returns true if this case is abusiness case
and false if it is a sub case.boolean
isPersistent()
Checks if the case is persistent.void
setActiveEnvironment(String environmentName)
Sets theIEnvironment
on this case.void
setBusinessCalendar(IBusinessCalendar calendar)
Defines theIBusinessCalendar
for thisICase
.void
setCategoryPath(String categoryPath)
Sets the given String as category path of thisICase
.default void
setCreatorUser(IUser creatorUser)
Sets the given user as case creator.void
setDescription(String description)
Sets the description of the casevoid
setName(String name)
Sets the name of the casevoid
setOwner(ISecurityMember owner)
Sets the owner of the case.void
setPriority(WorkflowPriority priority)
Sets the priority of the case-
Methods inherited from interface ch.ivyteam.ivy.workflow.IAdditionalPropertyable
getAdditionalProperty, getAdditionalPropertyNames, setAdditionalProperty
-
Methods inherited from interface ch.ivyteam.ivy.workflow.INoteable
createNote, deleteNote, getNotes, hasNotes
-
-
-
-
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
-
getBusinessCase
IBusinessCase getBusinessCase()
Gets the
business case
this case belongs to.If this case is a
business case
then the this case is returned.- sub case then the
business case
the sub case belongs to is returned.
- Returns:
- business case this case belongs to. Never null.
- Since:
- 6.5
- See Also:
isBusinessCase()
,attachToBusinessCase(long)
- API:
- This public API is available in IvyScript and Java. It has the visibility ADVANCED.
-
isBusinessCase
boolean isBusinessCase()
Returns true if this case is abusiness case
and false if it is a sub case.- Returns:
- true if this case is a
business case
- Since:
- 6.5
- See Also:
getBusinessCase()
,attachToBusinessCase(long)
- API:
- This public API is available in IvyScript and Java. It has the visibility ADVANCED.
-
attachToBusinessCase
void attachToBusinessCase(long businessCaseId)
Attaches this case to a
business case
with the given id. If this case is already attached to abusiness case
or already have sub cases then an IllegalStateException is thrown. If the given id does not belong to abusiness case
or belongs to a case of another application then an IllegalArgumentException is thrown.- Parameters:
businessCaseId
-- Throws:
IllegalStateException
- if the case is already attached to a business case or has sub casesIllegalArgumentException
- if the given businessCaseId is not valid- Since:
- 6.5
- See Also:
getBusinessCase()
,isBusinessCase()
- API:
- This public API is available in IvyScript and Java. It has the visibility EXPERT.
- Security:
- SESSION OWNS CaseAttachToBusinessCase PERMISSION OR OWNS CaseAttachToBusinessCase@SYSTEM PERMISSION
-
getId
long getId()
Returns the case identifier- Returns:
- case identifier
- API:
- This public API is available in IvyScript and Java. It has the visibility EXPERT.
-
getTasks
List<ITask> getTasks()
Gets all tasks- Returns:
- Enumeration with all tasks
- 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
-
getActiveTasks
List<ITask> getActiveTasks()
Gets all tasks in a active state- Returns:
- Iterator with all tasks in a active state
- 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
-
getFirstTask
ITask getFirstTask()
Gets the first task of the case. The task that is started at the start process element.- Returns:
- first task
- API:
- This public API is available in IvyScript and Java. It has the visibility EXPERT.
-
getCreatorUser
IUser getCreatorUser()
Gets the user who created this case. Maybe null if user is not known e.g. the case was created by an unknown user or the user was deleted since this case was started. In this case (user was deleted) the name of the user who created the case and was deleted in the meanwhile can be evaluated with the methodgetCreatorUserName()
. This method will return the name of the user who created this case even if the user was deleted.- Returns:
- creator user or null
- API:
- This public API is available in IvyScript and Java. It has the visibility NOVICE.
- Security:
- SESSION OWNS CaseReadCreatorUser PERMISSION OR OWNS CaseReadCreatorUser@SYSTEM PERMISSION
-
getCreatorUserName
String getCreatorUserName()
Gets the name of the user who created this case. Maybe null if user is not known e.g. the case was created by an unknown user. Note that this method will provide the name of the user even if the user does not exists anymore.- Returns:
- name of the user who created this case
- API:
- This public API is available in IvyScript and Java. It has the visibility NOVICE.
- Security:
- SESSION OWNS CaseReadCreatorUserName PERMISSION OR OWNS CaseReadCreatorUserName@SYSTEM PERMISSION
-
setCreatorUser
default void setCreatorUser(IUser creatorUser)
Sets the given user as case creator.- Parameters:
creatorUser
- the user to set as case creator.null
indicates the user is unknown (e.g. an anonymous user)- Since:
- 6.7
- API:
- This public API is available in IvyScript and Java. It has the visibility NOVICE.
-
getCreatorTask
ITask getCreatorTask()
Gets the task that created this case with a trigger element, maybe null if case was not started through a trigger element.- Returns:
- creator task
- API:
- This public API is available in IvyScript and Java. It has the visibility ADVANCED.
- Security:
- SESSION OWNS TaskRead PERMISSION OR OWNS TaskRead@SYSTEM PERMISSION
-
getActiveEnvironment
String getActiveEnvironment()
- Returns:
- The name of the environment which is set on the case or
null
if none is set. - API:
- This public API is available in IvyScript and Java. It has the visibility EXPERT.
-
setActiveEnvironment
void setActiveEnvironment(String environmentName)
Sets theIEnvironment
on this case. This will override the environment settings defined on theapplication
or thesession
.
For detailed description of the environment evaluation seeIApplication.getActualEnvironment()
.It is not possible to set the
default environment
.- Parameters:
environmentName
- Name of the environment. Usenull
or an empty string to set none- Throws:
NoSuchElementException
- If no environment with the given name exists.IllegalArgumentException
- If thedefault environment name
was given- See Also:
IApplication.getActualEnvironment()
- API:
- This public API is available in IvyScript and Java. It has the visibility EXPERT.
-
getProcessStart
IProcessStart getProcessStart()
Get the process start the case was started on- Returns:
- process start
- API:
- This public API is available in IvyScript and Java. It has the visibility EXPERT.
- Security:
- SESSION OWNS ProcessStartRead PERMISSION OR OWNS ProcessStartRead@SYSTEM PERMISSION
-
getPageArchives
List<IPageArchive> getPageArchives()
Gets all page archives associated with this case- Returns:
- list with the page archives
- API:
- This public API is available in IvyScript and Java. It has the visibility ADVANCED.
-
getWorkflowEvents
List<IWorkflowEvent> getWorkflowEvents()
Gets the workflow events of this case- 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
-
getStartTimestamp
Date getStartTimestamp()
Gets the start timestamp of the case- Returns:
- start timestamp
- API:
- This public API is available in IvyScript and Java. It has the visibility NOVICE.
- Security:
- SESSION OWNS CaseReadStartTimestamp PERMISSION OR OWNS CaseReadStartTimestamp@SYSTEM PERMISSION
-
getEndTimestamp
Date getEndTimestamp()
Gets the end timestamp of the case. Maybe null if case is not yet finished- Returns:
- end timestamp. Maybe null
- API:
- This public API is available in IvyScript and Java. It has the visibility NOVICE.
- Security:
- SESSION OWNS CaseReadEndTimestamp PERMISSION OR OWNS CaseReadEndTimestamp@SYSTEM PERMISSION
-
getBusinessRuntime
BusinessDuration getBusinessRuntime()
Gets the
BusinessDuration
between the creation (seegetStartTimestamp()
) and the completion (seegetEndTimestamp()
) of this case.The business runtime is calculated only when a case ends (state changes to
CaseState.DONE
).To calculate the
BusinessDuration
theIDefaultBusinessCalendar
of the case is used.- Returns:
BusinessDuration
between creation and completion. Returnsnull
if the case is not yet completed or the case has been completed before the business runtime feature was introduced.- Since:
- Pilatus
- See Also:
getStartTimestamp()
,getEndTimestamp()
,IBusinessCalendar.getBusinessDuration(DateTime, DateTime)
- 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 case.
The working time is the sum of the working times from all tasks of this case. Whenever a task working time changes, the corresponding case working time is recalculated.- Returns:
- Working time as
Duration
.
Returnsnull
for the following situations:- no task has been parked or completed
- the case has been completed before the working time feature was introduced.
- Since:
- Pilatus
- See Also:
ITask.getWorkingTime()
- API:
- This public API is available in IvyScript and Java. It has the visibility EXPERT.
-
setOwner
void setOwner(ISecurityMember owner)
Sets the owner of the case.- Parameters:
owner
- ornull
- See Also:
getOwner()
- API:
- This public API is available in IvyScript and Java. It has the visibility EXPERT.
-
getOwner
ISecurityMember getOwner()
Returns the owner of the case. Maybe null if no owner was set withsetOwner(ISecurityMember)
.
The intend of the owner is only for descriptive purpose and has no influence on the behavior of the Workflow Engine. This may can be used for example in Workflow UIs to search and filter in case lists.- Returns:
- owner or
null
- API:
- This public API is available in IvyScript and Java. It has the visibility EXPERT.
-
getOwnerName
String getOwnerName()
Returns the name of the owner. Maybe null if no owner was set withsetOwner(ISecurityMember)
. Does not return null if theISecurityMember
was deleted.- Returns:
- name of the owner or
null
- See Also:
getOwner()
- API:
- This public API is available in IvyScript and Java. It has the visibility EXPERT.
-
setCategoryPath
void setCategoryPath(String categoryPath)
Sets the given String as category path of thisICase
. Use "/" as path separator.null
or an empty string could be used to reset the path.- Parameters:
categoryPath
- the category path of thisICase
.- See Also:
getCategoryPath()
,getCategory()
,Category
- API:
- This public API is available in IvyScript and Java. It has the visibility ADVANCED.
- Security:
- SESSION OWNS CaseWriteCategory PERMISSION OR OWNS CaseWriteCategory@SYSTEM PERMISSION
-
getCategoryPath
String getCategoryPath()
Returns the category path of thisICase
.The method
getCategory()
returns the correspondingCategory
to the current 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 CaseReadCategory PERMISSION OR OWNS CaseReadCategory@SYSTEM PERMISSION
-
getCategory
Category getCategory()
Returns theCategory
of thisICase
. TheCategory
provides locale specific information like the name of a category path, as defined in the CMS. SeeCategory
for more information.The method
setCategoryPath(String)
allows to set the category of a case.- Returns:
- the current
Category
, corresponding to the current category path, nevernull
- See Also:
setCategoryPath(String)
,getCategoryPath()
,Category
- API:
- This public API is available in IvyScript and Java. It has the visibility ADVANCED.
- Security:
- SESSION OWNS CaseReadCategory PERMISSION OR OWNS CaseReadCategory@SYSTEM PERMISSION
-
getState
CaseState getState()
Get state of the case- Returns:
- state of the case
- API:
- This public API is available in IvyScript and Java. It has the visibility ADVANCED.
- Security:
- SESSION OWNS CaseReadState PERMISSION OR OWNS CaseReadState@SYSTEM PERMISSION
-
getPriority
WorkflowPriority getPriority()
Gets the priority of the case- Returns:
- priority of the case
- API:
- This public API is available in IvyScript and Java. It has the visibility NOVICE.
- Security:
- SESSION OWNS CaseReadPriority PERMISSION OR OWNS CaseReadPriority@SYSTEM PERMISSION
-
setPriority
void setPriority(WorkflowPriority priority)
Sets the priority of the case- Parameters:
priority
- the new priority- API:
- This public API is available in IvyScript and Java. It has the visibility EXPERT.
- Security:
- SESSION OWNS CaseWritePriority PERMISSION OR OWNS CaseWritePriority@SYSTEM PERMISSION
-
isPersistent
boolean isPersistent()
Checks if the case is persistent. A case that is persistent will also be available after a system restart. A case is normally created non persistent with the following exception:- The case is created with a trigger element
- Returns:
- true if case is persistent, otherwise false
- See Also:
ITask.isPersistent()
- API:
- This public API is available in IvyScript and Java. It has the visibility EXPERT.
-
getName
String getName()
Get name of the case- Returns:
- name of the case
- API:
- This public API is available in IvyScript and Java. It has the visibility NOVICE.
- Security:
- SESSION OWNS CaseReadName PERMISSION OR OWNS CaseReadName@SYSTEM PERMISSION
-
setName
void setName(String name)
Sets the name of the case- Parameters:
name
- the new name of the case- API:
- This public API is available in IvyScript and Java. It has the visibility ADVANCED.
- Security:
- SESSION OWNS CaseWriteName PERMISSION OR OWNS CaseWriteName@SYSTEM PERMISSION
-
getDisplayNameTemplate
String getDisplayNameTemplate()
Gets the display name template of the case- Returns:
- name template
- API:
- This public API is available in IvyScript and Java. It has the visibility EXPERT.
- Security:
- SESSION OWNS CaseReadDisplayNameTemplate PERMISSION OR OWNS CaseReadDisplayNameTemplate@SYSTEM PERMISSION
-
getDescription
String getDescription()
Get description of the case- Returns:
- description of the case
- API:
- This public API is available in IvyScript and Java. It has the visibility NOVICE.
- Security:
- SESSION OWNS CaseReadDescription PERMISSION OR OWNS CaseReadDescription@SYSTEM PERMISSION
-
setDescription
void setDescription(String description)
Sets the description of the case- Parameters:
description
- the new name of the case- API:
- This public API is available in IvyScript and Java. It has the visibility ADVANCED.
- Security:
- SESSION OWNS CaseWriteDescription PERMISSION OR OWNS CaseWriteDescription@SYSTEM PERMISSION
-
getDisplayDescriptionTemplate
String getDisplayDescriptionTemplate()
Gets the display description template of the case- Returns:
- description template of the case
- API:
- This public API is available in IvyScript and Java. It has the visibility EXPERT.
- Security:
- SESSION OWNS CaseReadDisplayDescriptionTemplate PERMISSION OR OWNS CaseReadDisplayDescriptionTemplate@SYSTEM PERMISSION
-
customFields
ICustomFields customFields()
You can use custom fields to store additional, customer specific information on a case. You can use custom fields to search for or filter cases.
Examples:
Setting a custom field:
ivy.case.customFields().stringField("branchOffice").set("Zug");
Getting a custom field:
String branchOffice = ivy.case.customFields().stringField("branchOffice").getOrDefault("Luzern")
Getting all custom fields:
import ch.ivyteam.ivy.workflow.custom.field.ICustomField; List<ICustomField> customFields = ivy.case.customFields().all();
- Returns:
- custom fields
- Since:
- 7.3
- See Also:
CaseQuery.IFilterableColumns.customField()
- API:
- This public API is available in IvyScript and Java. It has the visibility NOVICE.
-
destroy
void destroy()
Destroys this case and all tasks that belongs to the case- API:
- This public API is available in IvyScript and Java. It has the visibility EXPERT.
- Security:
- SESSION OWNS CaseDestroy PERMISSION OR OWNS CaseDestroy@SYSTEM PERMISSION
-
setBusinessCalendar
void setBusinessCalendar(IBusinessCalendar calendar)
Defines theIBusinessCalendar
for thisICase
. 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.
-
documents
IDocumentService documents()
Returns a service for managing documents that are attached to the case.Examples:
Add a document to a case:
IDocument document = ivy.case.documents().add(new Path("images/myImage.png")).write().withContentFrom(in.file);
Get all documents attached to a case:
List<IDocument> documents = ivy.case.documents().getAll();
- Returns:
- case document service
- API:
- This public API is available in IvyScript and Java. It has the visibility NOVICE.
- Security:
- SESSION OWNS DocumentRead PERMISSION OR MATCHES THIS.IsInvolved AND OWNS DocumentOfInvolvedCaseRead PERMISSION OR OWNS DocumentRead@SYSTEM PERMISSION
-
-