public class Workflow extends java.lang.Object implements WorkflowConstants, JcmsConstants, java.lang.Comparable
Modifier and Type | Field and Description |
---|---|
static int |
DOCUMENT_DRAFT_PSTATUS |
static java.lang.String |
REVISION |
ACTION, ACTION_REPEAT, ACTION_TYPE, ACTION_WHEN, ALL_WF, ARCHIVED_PSTATUS, EXPIRED_PSTATUS, PUBLISHED_PSTATUS, ROLE, ROLE_DESCRIPTION, ROLE_GROUP, ROLE_GRPID, ROLE_ID, ROLE_MBRID, ROLE_MEMBER, ROLE_NAME, ROLE_TYPE, ROLE_WEIGHT, SCHEDULED_PSTATUS, STATE, STATE_DESCRIPTION, STATE_DURATION, STATE_LABEL, STATE_PSTATUS, STATE_REMINDER, STATE_TARGETPSTATUS, STATE_TYPE, STATESPE, TRANSITION, TRANSITION_GROUP, TRANSITION_ROLEID, TRANSITION_SOURCE, TRANSITION_TARGET, UNKNOWN_PSTATUS, WF_DEFAULT_ID, WF_DIR, WF_ELT_NAME, WF_ID, WF_INIT, WF_LABEL, WF_TYPE, WF_VERSION, WF_VERSION_VALUE, WFTYPE_PROCESS, WFTYPE_PUBLISH
ADATE_SEARCH, ADMIN_NOTES_PROP, ADVANCED_TAB, ARCHIVES_DIR, ASCII_WIDTH, CATEGORY_TAB, CDATE_SEARCH, COMMON_ALARM, CONTENT_TAB, COOKIE_MAX_AGE, CTRL_TOPIC_INTERNAL, CTRL_TOPIC_REF, CTRL_TOPIC_VALUE, CTRL_TOPIC_WRITE, CUSTOM_PROP, DOCCHOOSER_HEIGHT, DOCCHOOSER_WIDTH, DOCS_DIR, EDATE_SEARCH, EMAIL_REGEXP, ERROR_MSG, FORBIDDEN_FILE_ACCESS, FORBIDDEN_REDIRECT, FORCE_REDIRECT, ICON_ARCHIVE, ICON_LOCK, ICON_LOCK_STRONG, ICON_WARN, ICON_WH_BOOK_CLOSED, ICON_WH_BOOK_OPEN, INFORMATION_MSG, JALIOS_JUNIT_PROP, JCMS_CADDY, JCMS_MSG_LIST, JSYNC_DOWNLOAD_DIR, JSYNC_SYNC_ALARM, LOG_FILE, LOG_TOPIC_SECURITY, LOGGER_PROP, LOGGER_XMLPROP, MBR_PHOTO_DIR, MDATE_SEARCH, MONITOR_XML, OP_CREATE, OP_CREATE_STR, OP_DEEP_COPY, OP_DEEP_COPY_STR, OP_DEEP_DELETE, OP_DEEP_DELETE_STR, OP_DELETE, OP_DELETE_STR, OP_MERGE, OP_MERGE_STR, OP_UPDATE, OP_UPDATE_STR, PDATE_SEARCH, PHOTO_DIR, PHOTO_ICON, PHOTO_ICON_HEIGHT, PHOTO_ICON_WIDTH, PHOTO_LARGE, PHOTO_LARGE_HEIGHT, PHOTO_LARGE_WIDTH, PHOTO_NORMAL, PHOTO_NORMAL_HEIGHT, PHOTO_NORMAL_WIDTH, PHOTO_SMALL, PHOTO_SMALL_HEIGHT, PHOTO_SMALL_WIDTH, PHOTO_TINY, PHOTO_TINY_HEIGHT, PHOTO_TINY_WIDTH, PREVIOUS_TAB, PRINT_VIEW, PRIVATE_FILE_ACCESS, PUBLIC_FILE_ACCESS, READ_RIGHT_TAB, SDATE_SEARCH, SEARCHENGINE_ALARM, SESSION_AUTHORIZED_FILENAMES_SET, STATS_REPORT_DIR, STATUS_PROP, STORE_XML, TEMPLATE_TAB, THUMBNAIL_LARGE_HEIGHT, THUMBNAIL_LARGE_WIDTH, THUMBNAIL_SMALL_HEIGHT, THUMBNAIL_SMALL_WIDTH, TYPES_ICON_ALT_PROP, TYPES_ICON_SUFFIX_PROP, TYPES_ICON_TITLE_PROP, TYPES_PREFIX_PROP, TYPES_THUMB_SUFFIX_PROP, UDATE_SEARCH, UPDATE_RIGHT_TAB, UPLOAD_DIR, URL_REGEXP, WARNING_MSG, WEBAPP_PROP, WFEXPRESS_ALARM, WFREMINDER_ALARM, WORKFLOW_TAB, WORKFLOW_XML
CRLF, MILLIS_IN_ONE_DAY, MILLIS_IN_ONE_HOUR, MILLIS_IN_ONE_MINUTE, MILLIS_IN_ONE_MONTH, MILLIS_IN_ONE_SECOND, MILLIS_IN_ONE_WEEK, MILLIS_IN_ONE_YEAR
Constructor and Description |
---|
Workflow(org.jdom.Element elt)
Create a workflow from a JDOM Element
|
Workflow(java.util.Map<java.lang.String,java.lang.String> labelMap,
Workflow wf,
boolean clone)
Creates a workflow from a given workflow (clone workflow type, states, actions, roles and transitions).
|
Workflow(java.lang.String id,
java.lang.String type,
java.util.Map<java.lang.String,java.lang.String> labelMap,
boolean createInitState)
Creates a new empty workflow with the given label and id.
|
Workflow(Workflow wf)
Clones a workflow from a given workflow (clone workflow type, states, actions, roles and transitions).
|
Modifier and Type | Method and Description |
---|---|
void |
addRole(WFRole role)
Adds a WFRole to the workflow
|
void |
addRole(WFRole role,
boolean register)
Adds a WFRole to the workflow
|
void |
addState(WFState state)
Adds a state in this workflow
|
void |
addTransition(WFState source,
WFState target,
WFRole role)
Adds a transition in this workflow
|
boolean |
canChangeState(Member member,
Publication pub,
WFState target)
Checks if a given member can move a given publication in a given
state.
|
boolean |
canChangeState(Member member,
Publication pub,
WFState source,
WFState target)
Checks if a given member can move from a given state in a given
state
|
boolean |
canChangeState(WFRole role,
WFState source,
WFState target)
Checks if a given role can move from a given state in a given
state
|
boolean |
canWorkInState(Publication pub,
Member member,
WFState state)
Checks if a given member can work in a given state
|
void |
cloneStates(Workflow other)
Clones all the states of another workflow in this one.
|
int |
compareTo(java.lang.Object obj) |
void |
convertToProcessWorkflow()
Convert this (publish) workflow to a process workflow.
|
void |
convertToPublishWorkflow()
Convert this (process) workflow to a publish workflow.
|
void |
deleteRole(WFRole wfRole,
Member member)
Deletes the given WFRole
|
boolean |
equals(java.lang.Object obj) |
java.lang.String |
getId() |
java.util.Set<WFTransition> |
getIncomingTransitionSet(WFState state)
Returns all the transition the given state is the target.
|
WFState |
getInitState() |
java.lang.String |
getLabel(java.lang.String lang)
Returns a localized label.
|
java.util.Map<java.lang.String,java.lang.String> |
getLabelMap() |
java.util.Set<WFState> |
getNextStateSet(Publication pub,
Member member)
Returns all the states a given member can reach for a given
publication.
|
java.util.Set<WFState> |
getNextStateSet(Publication pub,
Member member,
WFState state,
Workspace ws)
Returns all the states a given member can reach from a given state
|
WFRole |
getRole(java.lang.String roleId)
Returns a WFRole from its id.
|
java.util.Set<WFRole> |
getRoleSet()
Gets the role set for this workflow
|
WFState |
getState(int pstatus)
Returns the WFState bound to the given pstatus
|
java.lang.String |
getStateLabel(int pstatus,
java.lang.String lang)
This convenient returns the label of WFState bound to the given
pstatus
|
java.util.Set<WFState> |
getStateSet()
Returns the state set of this workflow
|
java.util.Set<WFTransition> |
getTransitionSet() |
java.lang.String |
getType() |
java.util.Set<WFState> |
getWorkStateSet(Group group,
Workspace workspace)
Returns all the state a group can work in, for given Workspace.
|
java.util.Set<WFState> |
getWorkStateSet(Publication pub,
Member member)
Returns all the state a member can work in, for all Workspace.
|
java.util.Set<WFState> |
getWorkStateSet(Publication pub,
Member member,
Workspace workspace)
Returns all the state a member can work in, for given Workspace.
|
java.util.Set<WFState> |
getWorkStateSet(WFRole role)
Returns all the states bound to a given WFRole.
|
boolean |
isEmpty()
Check if the workflow is empty.
|
boolean |
isNew() |
boolean |
isProcessWorkflow()
Returns true if this workflow is a process workflow.
|
boolean |
isPublishWorkflow()
Returns true if this workflow is a publish workflow.
|
boolean |
isRoleInvolved(WFRole role)
Returns true if the given role is involved in this Workflow
|
boolean |
isUpdated() |
void |
reloadI18N()
Reload all I18N informations for this workflow.
|
void |
removeAllTransitions()
Removes all the transition of this workflow
|
void |
removeState(WFState state)
Removes a state in this workflow
|
void |
setId(java.lang.String id) |
void |
setInitState(WFState v) |
void |
setLabelMap(java.util.Map<java.lang.String,java.lang.String> labelMap) |
void |
setNew(boolean isNew) |
void |
setType(java.lang.String type) |
void |
setUpdated(boolean isUpdated) |
java.lang.String |
toString() |
java.lang.String |
toXml()
Returns the XML representation for this workflow.
|
java.lang.String |
toXml(boolean includeXmlHeader) |
public static final int DOCUMENT_DRAFT_PSTATUS
public static final java.lang.String REVISION
public Workflow(java.lang.String id, java.lang.String type, java.util.Map<java.lang.String,java.lang.String> labelMap, boolean createInitState)
labelMap
- localized label mapid
- the id of the workflowtype
- the type of the workflowcreateInitState
- if true creates a new state and uses it as initStatepublic Workflow(Workflow wf)
wf
- the workflow to clonepublic Workflow(java.util.Map<java.lang.String,java.lang.String> labelMap, Workflow wf, boolean clone)
labelMap
- localized label mapwf
- the workflow to cloneclone
- if true do generate a new id nor new wfrole idpublic Workflow(org.jdom.Element elt)
elt
- the Elementpublic void convertToPublishWorkflow()
public void convertToProcessWorkflow()
public void reloadI18N()
public java.lang.String getLabel(java.lang.String lang)
lang
- the languagepublic java.lang.String toXml()
public java.lang.String toXml(boolean includeXmlHeader)
public java.lang.String toString()
toString
in class java.lang.Object
public boolean isEmpty()
public boolean isPublishWorkflow()
public boolean isProcessWorkflow()
public boolean isRoleInvolved(WFRole role)
role
- the tested Rolepublic int compareTo(java.lang.Object obj)
compareTo
in interface java.lang.Comparable
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String getId()
public void setId(java.lang.String id)
public java.util.Map<java.lang.String,java.lang.String> getLabelMap()
public void setLabelMap(java.util.Map<java.lang.String,java.lang.String> labelMap)
public java.lang.String getType()
public void setType(java.lang.String type)
public WFState getInitState()
public void setInitState(WFState v)
public java.util.Set<WFTransition> getTransitionSet()
public java.util.Set<WFState> getStateSet()
public WFState getState(int pstatus)
pstatus
- the pstatus of the searched WFStatepublic java.lang.String getStateLabel(int pstatus, java.lang.String lang)
pstatus
- the pstatus of the searched WFStatelang
- the language code in which to retrieve the labelpublic java.util.Set<WFState> getWorkStateSet(Publication pub, Member member)
pub
- the publication to work onmember
- the memberpublic java.util.Set<WFState> getWorkStateSet(Publication pub, Member member, Workspace workspace)
pub
- the publication to work onmember
- the memberworkspace
- the Workspace in which to retrieve statepublic java.util.Set<WFState> getWorkStateSet(Group group, Workspace workspace)
group
- the groupworkspace
- the Workspace in which to retrieve statepublic java.util.Set<WFState> getWorkStateSet(WFRole role)
role
- public boolean canWorkInState(Publication pub, Member member, WFState state)
pub
- the publication to work onmember
- the memberstate
- the statepublic boolean canChangeState(WFRole role, WFState source, WFState target)
role
- the rolesource
- the source statetarget
- the target statepublic boolean canChangeState(Member member, Publication pub, WFState target)
member
- the memberpub
- the publicationtarget
- the target statepublic boolean canChangeState(Member member, Publication pub, WFState source, WFState target)
member
- the memberpub
- the publicationsource
- the source statetarget
- the target statepublic java.util.Set<WFState> getNextStateSet(Publication pub, Member member)
pub
- the publicationmember
- the memberpublic java.util.Set<WFState> getNextStateSet(Publication pub, Member member, WFState state, Workspace ws)
pub
- the publication to work onmember
- the memberstate
- the source statews
- the current workspacepublic void addState(WFState state)
state
- the state to addpublic void removeState(WFState state)
state
- the state to removepublic void addTransition(WFState source, WFState target, WFRole role)
source
- the source statetarget
- the target staterole
- the rolepublic void removeAllTransitions()
public java.util.Set<WFTransition> getIncomingTransitionSet(WFState state)
state
- the statepublic void cloneStates(Workflow other)
other
- the other workflow to clone the statepublic WFRole getRole(java.lang.String roleId)
roleId
- the role Idpublic java.util.Set<WFRole> getRoleSet()
public void addRole(WFRole role)
role
- the role to be addedpublic void addRole(WFRole role, boolean register)
role
- the role to be addedregister
- should register role to channelpublic void deleteRole(WFRole wfRole, Member member)
wfRole
- the WFRole to be deletedmember
- the member which perform this actionpublic boolean isNew()
public void setNew(boolean isNew)
isNew
- The isNew to set.public boolean isUpdated()
public void setUpdated(boolean isUpdated)
isUpdated
- The isUpdated to set.Copyright © 2001-2010 Jalios SA. All Rights Reserved.