Recipe¶
Bases: object
Recipe class represents the protocol to create a sequence of operations.
A Recipe defines an ordered list of recipe elements that controls the creation of a sequence of operations.
__init__(*args)
¶
Overload 1:
Default constructor.
Initializes a new instance of the Recipe class.
|
Overload 2:
Constructor with name.
Initializes a new instance of the Recipe class with a specified name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
string
|
The name of the recipe |
required |
fromXML(xml)
¶
Load from XML.
Populates the recipe information from an XML node.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
xml
|
XMLNode
|
The XML node containing recipe information |
required |
Raises:
| Type | Description |
|---|---|
InscoperException
|
If an error occurs |
toXML(xmlParent)
¶
Save to XML.
Exports the recipe information to an XML node attached to the parent node.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
xmlParent
|
XMLNode
|
The parent XML node |
required |
Raises:
| Type | Description |
|---|---|
InscoperException
|
If an error occurs |
getName()
¶
Get the recipe name.
Retrieves the name of the recipe.
Returns:
| Type | Description |
|---|---|
str
|
The name of the recipe |
setName(name)
¶
Set the recipe name.
Sets the name of the recipe.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
string
|
The name of the recipe |
required |
getRecipeElements()
¶
Get recipe elements.
Retrieves the list of elements that compose the recipe.
Returns:
| Type | Description |
|---|---|
list[RecipeElement]
|
The list of recipe elements |
setRecipeElementList(recipeElements)
¶
Set recipe elements.
Replaces the current list of recipe elements.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
recipeElements
|
list[RecipeElement]
|
The list of recipe elements |
required |
addRecipeElement(recipeElement)
¶
Add a recipe element.
Appends a recipe element at the end of the recipe's list.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
recipeElement
|
RecipeElement
|
The recipe element to add |
required |