com.silverpeas.workflow.engine.model
Class ProcessModelImpl

java.lang.Object
  extended by com.silverpeas.workflow.engine.model.ProcessModelImpl
All Implemented Interfaces:
AbstractDescriptor, ProcessModel, Serializable

public class ProcessModelImpl
extends Object
implements ProcessModel, AbstractDescriptor, Serializable

Class implementing the representation of the main <processModel> element of a Process Model.

See Also:
Serialized Form

Constructor Summary
ProcessModelImpl()
          Constructor
 
Method Summary
 void addDescription(ContextualDesignation description)
          Add a description Method needed primarily by Castor
 void addLabel(ContextualDesignation label)
          Add a label Method needed primarily by Castor
 Actions createActions()
          Create Actions
 DataFolder createDataFolder()
          Create DataFolder
 ContextualDesignation createDesignation()
          Create an object implementing ContextualDesignation Method needed primarily by Castor
 Forms createForms()
          Create Forms
 Participants createParticipants()
          Create Participants
 Presentation createPresentation()
          Create a Presentation
 QualifiedUsers createQualifiedUsers()
          Create an object implementing QualifiedUsers
 RelatedUser createRelatedUser()
          Create an object implementing RelatedUser
 Roles createRoles()
          Create Roles
 States createStates()
          Create States
 Action getAction(String name)
          Get the action with the given name
 Form getActionForm(String actionName)
          Returns the form (if any) associated to the named action.
 Action[] getActions()
          Get the actions defined for this process model
 Actions getActionsEx()
          Get the actions definitions
 RecordTemplate getAllDataTemplate(String role, String lang)
          Returns the recordTemplate which describes the data record of the process instance built from this model.
 Action getCreateAction(String role)
          Returns the action of kind create Throws a WorkflowException if there is no action of type create
 String[] getCreationRoles()
          Returns the roles under which an user can create a new instance
 DataFolder getDataFolder()
          Get the data folder defined for this process model
 String getDescription(String role, String language)
          Get description in specific language for the given role
 ContextualDesignations getDescriptions()
          Get all the descriptions
 RecordSet getFolderRecordSet()
          Returns the record set where are saved all the folder of the instance built from this model.
 String getFolderRecordSetName()
          Returns the name of the record set where are saved all the folder of the instance built from this model.
 Form getForm(String name)
          Get the form with the given name
 Form getForm(String name, String role)
          Get the form definition with given name for the given role
 RecordSet getFormRecordSet(String formName)
          Returns the record set where are saved all the data of the named form.
 String getFormRecordSetName(String formName)
          Returns the name of the record set where are saved all the data of the named form.
 Forms getForms()
          Get the forms definitions
 int getId()
           
 String getLabel(String role, String language)
          Get label in specific language for the given role
 ContextualDesignations getLabels()
          Get all the labels
 String getModelId()
          Get the id of this process model
 String getName()
          Get the name of this process model
 DataRecord getNewActionRecord(String actionName, String roleName, String lang, DataRecord data)
          Returns an empty com.silverpeas.form.DataRecord which must be filled in order to process the named action.
 DataRecord getNewUserInfosRecord(String roleName, String lang)
          Returns an empty com.silverpeas.form.DataRecord which must be filled in order to fill the user information Throws a WorkflowException if problem encountered.
 AbstractDescriptor getParent()
           
 Participant[] getParticipants()
          Get the participants definition
 Participants getParticipantsEx()
          Get all the participants definitions
 Presentation getPresentation()
          Get the presentation configuration
 Presentation getPresentationForCastor()
          Get the presentation configuration for Castor
 Form getPresentationForm(String name, String roleName, String lang)
          Returns the com.silverpeas.form.Form which be used to publish the form associated to the named action or form.
 Form getPublicationForm(String actionName, String roleName, String lang)
          Returns the com.silverpeas.form.Form which be used to publish the form associated to the named action.
 Role getRole(String name)
          Get the role definition with given name
 Role[] getRoles()
          Get the roles definition
 Roles getRolesEx()
          Get the Roles definitions
 RecordTemplate getRowTemplate(String role, String lang)
          Returns the recordTemplate which describes the data record used to show process instance as a row in list.
 State getState(String name)
          Get the state with the given name
 State[] getStates()
          Get the states defined for this process model
 States getStatesEx()
          Get the states definitions
 DataFolder getUserInfos()
          Get the user infos defined for this process model It contains all the items necessary about user to allow him to use the instance
 boolean hasId()
           
 Iterator<ContextualDesignation> iterateDescription()
          Iterate through the descriptions
 Iterator<ContextualDesignation> iterateLabel()
          Iterate through the Labels
 void setActions(Actions actions)
          Set the actions defined for this process model
 void setDataFolder(DataFolder dataFolder)
          Set the data folder defined for this process model
 void setForms(Forms forms)
          Set the forms defined for this process model
 void setId(int id)
          Implemented methods
 void setModelId(String modelId)
          Set the id of this process model
 void setName(String name)
          Set the name of this process model
 void setParent(AbstractDescriptor parent)
           
 void setParticipants(Participants participants)
          Set the participants definition
 void setPresentation(Presentation presentation)
          Set the presentation's configuration
 void setRoles(Roles roles)
          Set the roles definition
 void setStates(States states)
          Set the states defined for this process model
 void setUserInfos(DataFolder userInfos)
          Set the user infos defined for this process model It contains all the items necessary about user to allow him to use the instance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProcessModelImpl

public ProcessModelImpl()
Constructor

Method Detail

getModelId

public String getModelId()
Get the id of this process model

Specified by:
getModelId in interface ProcessModel
Returns:
process model id

setModelId

public void setModelId(String modelId)
Set the id of this process model

Specified by:
setModelId in interface ProcessModel
Parameters:
name - process model id

getName

public String getName()
Get the name of this process model

Specified by:
getName in interface ProcessModel
Returns:
process model's name

setName

public void setName(String name)
Set the name of this process model

Specified by:
setName in interface ProcessModel
Parameters:
name - process model's name

getPresentation

public Presentation getPresentation()
Get the presentation configuration

Specified by:
getPresentation in interface ProcessModel
Returns:
presentation configuration

getPresentationForCastor

public Presentation getPresentationForCastor()
Get the presentation configuration for Castor

Returns:
presentation configuration if not empty, otherwise null

setPresentation

public void setPresentation(Presentation presentation)
Set the presentation's configuration

Specified by:
setPresentation in interface ProcessModel
Parameters:
presentation - presentation's configuration

createPresentation

public Presentation createPresentation()
Description copied from interface: ProcessModel
Create a Presentation

Specified by:
createPresentation in interface ProcessModel
Returns:
an object implementing Presentation

getParticipants

public Participant[] getParticipants()
Get the participants definition

Specified by:
getParticipants in interface ProcessModel
Returns:
participants definition

getParticipantsEx

public Participants getParticipantsEx()
Description copied from interface: ProcessModel
Get all the participants definitions

Specified by:
getParticipantsEx in interface ProcessModel

setParticipants

public void setParticipants(Participants participants)
Set the participants definition

Specified by:
setParticipants in interface ProcessModel
Parameters:
participants - participants definition

createParticipants

public Participants createParticipants()
Description copied from interface: ProcessModel
Create Participants

Specified by:
createParticipants in interface ProcessModel
Returns:
an object implementing Participants

getRoles

public Role[] getRoles()
Get the roles definition

Specified by:
getRoles in interface ProcessModel
Returns:
roles definition

getRole

public Role getRole(String name)
Get the role definition with given name

Specified by:
getRole in interface ProcessModel
Parameters:
name - role name
Returns:
wanted role definition

getRolesEx

public Roles getRolesEx()
Description copied from interface: ProcessModel
Get the Roles definitions

Specified by:
getRolesEx in interface ProcessModel

setRoles

public void setRoles(Roles roles)
Set the roles definition

Specified by:
setRoles in interface ProcessModel
Parameters:
roles - roles definition

createRoles

public Roles createRoles()
Description copied from interface: ProcessModel
Create Roles

Specified by:
createRoles in interface ProcessModel
Returns:
an object implementing Roles

getStates

public State[] getStates()
Get the states defined for this process model

Specified by:
getStates in interface ProcessModel
Returns:
states defined for this process model

getStatesEx

public States getStatesEx()
Description copied from interface: ProcessModel
Get the states definitions

Specified by:
getStatesEx in interface ProcessModel

getState

public State getState(String name)
Get the state with the given name

Specified by:
getState in interface ProcessModel
Parameters:
name - state name
Returns:
wanted state

setStates

public void setStates(States states)
Set the states defined for this process model

Specified by:
setStates in interface ProcessModel
Parameters:
states - states defined for this process model

createStates

public States createStates()
Description copied from interface: ProcessModel
Create States

Specified by:
createStates in interface ProcessModel
Returns:
an object implementing States

getActions

public Action[] getActions()
Get the actions defined for this process model

Specified by:
getActions in interface ProcessModel
Returns:
actions defined for this process model

getActionsEx

public Actions getActionsEx()
Description copied from interface: ProcessModel
Get the actions definitions

Specified by:
getActionsEx in interface ProcessModel

getAction

public Action getAction(String name)
                 throws WorkflowException
Get the action with the given name

Specified by:
getAction in interface ProcessModel
Parameters:
name - action name
Returns:
the wanted action
Throws:
WorkflowException

setActions

public void setActions(Actions actions)
Set the actions defined for this process model

Specified by:
setActions in interface ProcessModel
Parameters:
actions - actions defined for this process model

createActions

public Actions createActions()
Description copied from interface: ProcessModel
Create Actions

Specified by:
createActions in interface ProcessModel
Returns:
an object implementing Actions

getDataFolder

public DataFolder getDataFolder()
Get the data folder defined for this process model

Specified by:
getDataFolder in interface ProcessModel
Returns:
data folder defined for this process model. it contains all the items declarations

setDataFolder

public void setDataFolder(DataFolder dataFolder)
Set the data folder defined for this process model

Specified by:
setDataFolder in interface ProcessModel
Parameters:
dataFolder - data folder defined for this process model. it contains all the items declarations

createDataFolder

public DataFolder createDataFolder()
Description copied from interface: ProcessModel
Create DataFolder

Specified by:
createDataFolder in interface ProcessModel
Returns:
an object implementing DataFolder

getUserInfos

public DataFolder getUserInfos()
Get the user infos defined for this process model It contains all the items necessary about user to allow him to use the instance

Specified by:
getUserInfos in interface ProcessModel
Returns:
user infos defined for this process model.

setUserInfos

public void setUserInfos(DataFolder userInfos)
Set the user infos defined for this process model It contains all the items necessary about user to allow him to use the instance

Specified by:
setUserInfos in interface ProcessModel
Parameters:
userInfos - user infos defined for this process model.

getForms

public Forms getForms()
Description copied from interface: ProcessModel
Get the forms definitions

Specified by:
getForms in interface ProcessModel

getForm

public Form getForm(String name)
Get the form with the given name

Specified by:
getForm in interface ProcessModel
Parameters:
name - form name
Returns:
the wanted form

getForm

public Form getForm(String name,
                    String role)
Description copied from interface: ProcessModel
Get the form definition with given name for the given role

Specified by:
getForm in interface ProcessModel
Parameters:
name - action form
Returns:
wanted form definition

setForms

public void setForms(Forms forms)
Set the forms defined for this process model

Specified by:
setForms in interface ProcessModel
Parameters:
forms - forms defined for this process model.

createForms

public Forms createForms()
Description copied from interface: ProcessModel
Create Forms

Specified by:
createForms in interface ProcessModel
Returns:
an object implementing Forms

createDesignation

public ContextualDesignation createDesignation()
Description copied from interface: ProcessModel
Create an object implementing ContextualDesignation Method needed primarily by Castor

Specified by:
createDesignation in interface ProcessModel

getLabels

public ContextualDesignations getLabels()
Description copied from interface: ProcessModel
Get all the labels

Specified by:
getLabels in interface ProcessModel
Returns:
an object containing the collection of the labels

getLabel

public String getLabel(String role,
                       String language)
Get label in specific language for the given role

Specified by:
getLabel in interface ProcessModel
Parameters:
lang - label's language
role - role for which the label is
Returns:
wanted label as a String object. If label is not found, search label with given role and default language, if not found again, return the default label in given language, if not found again, return the default label in default language, if not found again, return empty string.

addLabel

public void addLabel(ContextualDesignation label)
Description copied from interface: ProcessModel
Add a label Method needed primarily by Castor

Specified by:
addLabel in interface ProcessModel

iterateLabel

public Iterator<ContextualDesignation> iterateLabel()
Description copied from interface: ProcessModel
Iterate through the Labels

Specified by:
iterateLabel in interface ProcessModel
Returns:
an iterator

getDescriptions

public ContextualDesignations getDescriptions()
Description copied from interface: ProcessModel
Get all the descriptions

Specified by:
getDescriptions in interface ProcessModel
Returns:
an object containing the collection of the descriptions

getDescription

public String getDescription(String role,
                             String language)
Get description in specific language for the given role

Specified by:
getDescription in interface ProcessModel
Parameters:
lang - description's language
role - role for which the description is
Returns:
wanted description as a String object. If description is not found, search description with given role and default language, if not found again, return the default description in given language, if not found again, return the default description in default language, if not found again, return empty string.

addDescription

public void addDescription(ContextualDesignation description)
Description copied from interface: ProcessModel
Add a description Method needed primarily by Castor

Specified by:
addDescription in interface ProcessModel

iterateDescription

public Iterator<ContextualDesignation> iterateDescription()
Description copied from interface: ProcessModel
Iterate through the descriptions

Specified by:
iterateDescription in interface ProcessModel
Returns:
an iterator

createQualifiedUsers

public QualifiedUsers createQualifiedUsers()
Description copied from interface: ProcessModel
Create an object implementing QualifiedUsers

Specified by:
createQualifiedUsers in interface ProcessModel

createRelatedUser

public RelatedUser createRelatedUser()
Description copied from interface: ProcessModel
Create an object implementing RelatedUser

Specified by:
createRelatedUser in interface ProcessModel

getFolderRecordSetName

public String getFolderRecordSetName()
Returns the name of the record set where are saved all the folder of the instance built from this model.

Specified by:
getFolderRecordSetName in interface ProcessModel

getFormRecordSetName

public String getFormRecordSetName(String formName)
Returns the name of the record set where are saved all the data of the named form.

Specified by:
getFormRecordSetName in interface ProcessModel

getFolderRecordSet

public RecordSet getFolderRecordSet()
                             throws WorkflowException
Returns the record set where are saved all the folder of the instance built from this model.

Specified by:
getFolderRecordSet in interface ProcessModel
Throws:
WorkflowException

getFormRecordSet

public RecordSet getFormRecordSet(String formName)
                           throws WorkflowException
Returns the record set where are saved all the data of the named form.

Specified by:
getFormRecordSet in interface ProcessModel
Throws:
WorkflowException

getActionForm

public Form getActionForm(String actionName)
                   throws WorkflowException
Returns the form (if any) associated to the named action. Returns null if the action has no form. Throws a WorkflowException if the action is unknown.

Specified by:
getActionForm in interface ProcessModel
Throws:
WorkflowException

getCreateAction

public Action getCreateAction(String role)
                       throws WorkflowException
Returns the action of kind create Throws a WorkflowException if there is no action of type create

Specified by:
getCreateAction in interface ProcessModel
Throws:
WorkflowException

getPublicationForm

public Form getPublicationForm(String actionName,
                               String roleName,
                               String lang)
                        throws WorkflowException
Returns the com.silverpeas.form.Form which be used to publish the form associated to the named action. Returns null if the action has no form. Throws a WorkflowException if the action is unknown.

Specified by:
getPublicationForm in interface ProcessModel
Throws:
WorkflowException

getPresentationForm

public Form getPresentationForm(String name,
                                String roleName,
                                String lang)
                         throws WorkflowException
Returns the com.silverpeas.form.Form which be used to publish the form associated to the named action or form. Returns null if the action has no form.

Specified by:
getPresentationForm in interface ProcessModel
Throws:
WorkflowException

getNewActionRecord

public DataRecord getNewActionRecord(String actionName,
                                     String roleName,
                                     String lang,
                                     DataRecord data)
                              throws WorkflowException
Returns an empty com.silverpeas.form.DataRecord which must be filled in order to process the named action. Returns null if no form is required to process this action. Throws a WorkflowException if the action is unknown.

Specified by:
getNewActionRecord in interface ProcessModel
Throws:
WorkflowException

getNewUserInfosRecord

public DataRecord getNewUserInfosRecord(String roleName,
                                        String lang)
                                 throws WorkflowException
Returns an empty com.silverpeas.form.DataRecord which must be filled in order to fill the user information Throws a WorkflowException if problem encountered.

Specified by:
getNewUserInfosRecord in interface ProcessModel
Throws:
WorkflowException

getCreationRoles

public String[] getCreationRoles()
                          throws WorkflowException
Returns the roles under which an user can create a new instance

Specified by:
getCreationRoles in interface ProcessModel
Throws:
WorkflowException

getAllDataTemplate

public RecordTemplate getAllDataTemplate(String role,
                                         String lang)
Returns the recordTemplate which describes the data record of the process instance built from this model.

Specified by:
getAllDataTemplate in interface ProcessModel

getRowTemplate

public RecordTemplate getRowTemplate(String role,
                                     String lang)
Returns the recordTemplate which describes the data record used to show process instance as a row in list.

Specified by:
getRowTemplate in interface ProcessModel

setId

public void setId(int id)
Implemented methods

Specified by:
setId in interface AbstractDescriptor

getId

public int getId()
Specified by:
getId in interface AbstractDescriptor

setParent

public void setParent(AbstractDescriptor parent)
Specified by:
setParent in interface AbstractDescriptor

getParent

public AbstractDescriptor getParent()
Specified by:
getParent in interface AbstractDescriptor

hasId

public boolean hasId()
Specified by:
hasId in interface AbstractDescriptor


Copyright © 2016 Silverpeas. All Rights Reserved.