public class TransitionChoiceCategory extends ChoiceCategory
Constructor and Description |
---|
TransitionChoiceCategory(java.lang.String name,
int keystoragelength)
creates a transition choice category with given name and storage length
|
Modifier and Type | Method and Description |
---|---|
void |
addValue(ChoiceValue value)
adds a choice value to this choice category
|
void |
DefineTransition(ChoiceValue startvalue,
ChoiceValue endvalue) |
void |
generatetoFile(SourceGenerator sg,
Module module)
* generates the source of the choice category to a file
|
ChoiceValue |
getDefaultChoice() |
ChoiceValue |
getDefaultWorkingChoice() |
java.lang.String |
getDefinitionClass() |
int |
getDisplayLabelLength(int label)
This method checks what is the longest label in the choice values, and
returns that value, or the value of label length if higher
|
boolean |
hasChoiceValue(ChoiceValue externalvalue)
returns true if the transition choice category included a choice value with a
similar name (storage code)
|
boolean |
hasDefaultWorkingChoice() |
boolean |
hasFinalChoice() |
boolean |
isKeyPresent(java.lang.String key)
checks if a choice value with the given key is present
|
void |
setAuthorizeAllTransitions()
if this method is called, all transitions will be authorized.
|
void |
setChoiceAsFinal(ChoiceValue finalchoice)
declares the choice as final which means that if there is a final state date,
the date will be filled when transition to this state
|
void |
setDefaultChoice(ChoiceValue defaultchoice)
the choice a new object will use for a lifecycle
|
void |
setDefaultFinalChoice(ChoiceValue defaultfinalchoice)
sets a choice as default final choice.
|
void |
setDefaultWorkingChoice(ChoiceValue defaultworkingchoice)
the choice the object lifecycle will move to when someone accepts a task to
work on the object in a one step workflow.
Note: a default working choice should have a transition from and to the default choice. |
getKeyStorageLength, getParentModule, isPseudoNumber, setParentModule
changeName, cleanName, equals, getName
public TransitionChoiceCategory(java.lang.String name, int keystoragelength)
name
- a name that should be unique in the modulekeystoragelength
- should be higher or equal to the largest name /
storage code of the choice valuespublic boolean hasChoiceValue(ChoiceValue externalvalue)
externalvalue
- a choice valuepublic ChoiceValue getDefaultWorkingChoice()
public ChoiceValue getDefaultChoice()
public void DefineTransition(ChoiceValue startvalue, ChoiceValue endvalue)
startvalue
- endvalue
- public boolean hasFinalChoice()
public void setDefaultChoice(ChoiceValue defaultchoice)
defaultchoice
- choice to use as a lifecycle (needs to have been added
before)public void setDefaultWorkingChoice(ChoiceValue defaultworkingchoice)
defaultworkingchoice
- default working choice (should be already
registered)public void setChoiceAsFinal(ChoiceValue finalchoice)
finalchoice
- state to be used as final choice (should be already
registered)public void setAuthorizeAllTransitions()
public void addValue(ChoiceValue value)
value
- the value to addpublic boolean hasDefaultWorkingChoice()
public void setDefaultFinalChoice(ChoiceValue defaultfinalchoice)
defaultfinalchoice
- the choice (already registered) that should be the
default final choicepublic java.lang.String getDefinitionClass()
getDefinitionClass
in class ChoiceCategory
public void generatetoFile(SourceGenerator sg, Module module) throws java.io.IOException
ChoiceCategory
generatetoFile
in class ChoiceCategory
sg
- source generatormodule
- parent modulejava.io.IOException
- if anything nasty happens while writing the filepublic int getDisplayLabelLength(int label)
ChoiceCategory
getDisplayLabelLength
in class ChoiceCategory
label
- specifying the maximum of the labels of the choice values,
and the input length provided (typically for column title)public boolean isKeyPresent(java.lang.String key)
ChoiceCategory
isKeyPresent
in class ChoiceCategory
key
- the key