Stay organized with collections
Save and categorize content based on your preferences.
blockly > Procedures > IProcedureModel
Procedures.IProcedureModel interface
A data model for a procedure.
Signature:
export interface IProcedureModel
Methods
Method |
Description |
deleteParameter(index) |
Removes the parameter at the given index from the parameter list. |
getEnabled() |
Returns whether the procedure is enabled/disabled. If a procedure is disabled, all procedure caller blocks should be disabled as well. |
getId() |
Returns the unique language-neutral ID for the procedure. |
getName() |
Returns the human-readable name of the procedure. |
getParameter(index) |
Returns the parameter at the given index in the parameter list. |
getParameters() |
Returns an array of all of the parameters in the parameter list. |
getReturnTypes() |
Returns the return type(s) of the procedure. Null represents a procedure that does not return a value. |
insertParameter(parameterModel, index) |
Inserts a parameter into the list of parameters. To move a parameter, first delete it, and then re-insert. |
saveState() |
Serializes the state of the procedure to JSON. |
setEnabled(enabled) |
Sets whether this procedure is enabled/disabled. If a procedure is disabled all procedure caller blocks should be disabled as well. |
setName(name) |
Sets the human-readable name of the procedure. |
setReturnTypes(types) |
Sets the return type(s) of the procedure. Pass null to represent a procedure that does not return. |
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-09-18 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-09-18 UTC."],[[["`IProcedureModel` is an interface that defines a data model for procedures in Blockly."],["It provides methods for managing procedure parameters, such as adding, removing, and accessing them."],["The interface also includes methods for controlling the procedure's enabled status, name, and return types."],["`IProcedureModel` enables saving and loading the procedure's state through serialization."],["This model is crucial for representing and manipulating procedures within the Blockly environment."]]],["The `IProcedureModel` interface manages procedure data. Key actions include: retrieving the procedure's ID, name, enabled status, parameters, and return types. Parameters can be managed by inserting, deleting, and retrieving them. The name, enabled status, and return types can be set. It supports getting all parameters as an array. Additionally, it allows saving the procedure's state and has the capacity of disabling or enabling it.\n"]]