Package com.appiancorp.suiteapi.process
Class Palette
java.lang.Object
com.appiancorp.suiteapi.common.Identity
com.appiancorp.suiteapi.process.Palette
- All Implemented Interfaces:
LocalId
,XMLable
,Serializable
Holds a collection of nodes that can be dropped onto a canvas in the designer to create a
process. Each node is represented as a
PaletteItem
, and the activity class schema
the node represents is stored as an ActivityClassSchema
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
A name/id object that can be used by the UI -
Field Summary
Fields inherited from interface com.appiancorp.suiteapi.common.XMLable
DEFAULT_BUFFER_SIZE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds anActivityClassSchema
to the existing schemas for this palette.void
addItem
(PaletteItem paletteItem) Adds aPaletteItem
to the existing items for this palette.boolean
containsPaletteItem
(PaletteItem paletteItem) Returnstrue
if this palette contains the specifiedPaletteItem
.Returns the palette's categorygetItems()
Returns thePaletteItem
s on the paletteReturns the activity class schemas associated with the paletteboolean
boolean
isSystem()
Whether the palette is provided by the system or is a custom one.void
removePaletteItem
(PaletteItem paletteItemToRemove) Removes the providedPaletteItem
from the palette.void
removePaletteItems
(List<PaletteItem> paletteItemsToRemove) Removes the providedPaletteItem
s from the palette.void
setCategory
(Long category_) Sets the palette's categoryvoid
setEnabled
(boolean enabled) void
setItems
(PaletteItem[] items) Sets the items in the palette.void
setSchemas
(ActivityClassSchema[] newSchemas) Sets the activity class schemas to be associated with this palette (removing the existing ones).void
setSystem
(boolean system) Sets the palette's system property which marks it as a system-provided palette.toXML()
Converts the palette to XML and returns it as as stringvoid
toXML
(StringBuilder buffer) Converts the palette to XML and stores it in a StringBufferMethods inherited from class com.appiancorp.suiteapi.common.Identity
equals, getId, getName, getUuid, hashCode, setId, setName, setUuid, toString
-
Constructor Details
-
Palette
public Palette() -
Palette
Creates a new Palette as a deep copy of a given one.- Parameters:
palette
- ThePalette
on which this instance should be based.
-
-
Method Details
-
isEnabled
public boolean isEnabled() -
setEnabled
public void setEnabled(boolean enabled) -
isSystem
public boolean isSystem()Whether the palette is provided by the system or is a custom one.- Returns:
- true if the palette has been provided by the system or false otherwise.
-
setSystem
public void setSystem(boolean system) Sets the palette's system property which marks it as a system-provided palette.- Parameters:
system
- whether the palette is provided by the system or is a custom one.
-
getCategory
Returns the palette's category- Returns:
- the ID of the category containing this palette
-
setCategory
Sets the palette's category- Parameters:
category_
- the ID of the category in which to place this palette
-
getItems
Returns thePaletteItem
s on the palette- Returns:
- an
Array
containing thePaletteItem
s on this palette
-
setItems
Sets the items in the palette. Removes the items previously in the palette.- Parameters:
items_
- thePaletteItem
s to place in this palette
-
getSchemas
Returns the activity class schemas associated with the palette- Returns:
- the
ActivityClassSchema
s associated with the palette
-
setSchemas
Sets the activity class schemas to be associated with this palette (removing the existing ones). Those schemas that are not mapped to an existingPaletteItem
in the palette then it will not be added.- Parameters:
newSchemas
- TheActivityClassSchema
s to be associated with this palette.
-
addActivityClassSchema
Adds anActivityClassSchema
to the existing schemas for this palette. If the schema is not mapped to an existingPaletteItem
in the palette then it will not be added. If the schema already exists in the palette then it will not overwrite the existing one.- Parameters:
acs
- the schema to add to the list
-
addItem
Adds aPaletteItem
to the existing items for this palette. If the palette already contains aPaletteItem
with the same name then the existingPaletteItem
is replaced with this new one.- Parameters:
paletteItem
- ThePaletteItem
to add to the palette
-
removePaletteItem
Removes the providedPaletteItem
from the palette. TheActivityClassSchema
associated with the palette item is also removed.- Parameters:
paletteItemToRemove
- The palette item to remove
-
removePaletteItems
Removes the providedPaletteItem
s from the palette. TheActivityClassSchema
s associated with the palette items are also removed.- Parameters:
paletteItemsToRemove
- The list of palette items to remove
-
containsPaletteItem
Returnstrue
if this palette contains the specifiedPaletteItem
. Specifically, returnstrue
if there is aPaletteItem
with the same name as the one of the providedPaletteItem
.- Parameters:
paletteItem
-PaletteItem
to look for- Returns:
true
if there is aPaletteItem
with the givenPaletteItem
's name
-
toXML
Converts the palette to XML and returns it as as string -
toXML
Converts the palette to XML and stores it in a StringBuffer
-