Stay organized with collections
Save and categorize content based on your preferences.
blockly > Procedures
Procedures namespace
Classes
Functions
Function |
Description |
allProcedures(root) |
Find all user-created procedure definitions in a workspace. |
findLegalName(name, block) |
Ensure two identically-named procedures don't exist. Take the proposed procedure name, and return a legal name i.e. one that is not empty and doesn't collide with other procedures. |
flyoutCategory(workspace, useXml) |
|
flyoutCategory(workspace, useXml) |
|
getCallers(name, workspace) |
Find all the callers of a named procedure. |
getDefinition(name, workspace) |
Find the definition block for the named procedure. |
isNameUsed(name, workspace, opt_exclude) |
Return if the given name is already a procedure name. |
isProcedureBlock(block) |
A type guard which checks if the given block is a procedure block. |
mutateCallers(defBlock) |
When a procedure definition changes its parameters, find and edit all its callers. |
rename(this, name) |
Rename a procedure. Called by the editable field. |
Interfaces
Variables
Variable |
Description |
CATEGORY_NAME |
String for use in the "custom" attribute of a category in toolbox XML. This string indicates that the category should be dynamically populated with procedure blocks. See also Blockly.Variables.CATEGORY_NAME and Blockly.VariablesDynamic.CATEGORY_NAME. |
DEFAULT_ARG |
The default argument for a procedures_mutatorarg block. |
Type Aliases
Type Alias |
Description |
ProcedureTuple |
Legacy means of representing a procedure signature. The elements are respectively: name, parameter names, and whether it has a return value. |
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 2025-05-16 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 2025-05-16 UTC."],[[["\u003cp\u003eThe Procedures namespace in Blockly manages the creation, modification, and interaction with procedures (custom functions) within Blockly workspaces.\u003c/p\u003e\n"],["\u003cp\u003eIt provides functionalities to define, call, rename, and find procedures, as well as manage their parameters.\u003c/p\u003e\n"],["\u003cp\u003eIt includes classes, functions, interfaces, variables, and type aliases to support procedure-related operations in Blockly.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can utilize this namespace to programmatically control procedures and integrate them into their Blockly applications.\u003c/p\u003e\n"],["\u003cp\u003eBlockly's procedure functionality enables users to create reusable blocks of code, enhancing the modularity and organization of their projects.\u003c/p\u003e\n"]]],[],null,["[blockly](./blockly.md) \\\u003e [Procedures](./blockly.procedures_namespace.md)\n\nProcedures namespace\n--------------------\n\nClasses\n-------\n\n| Class | Description |\n|------------------------------------------------------------------------------------------|-------------|\n| [ObservableProcedureMap](./blockly.procedures_namespace.observableproceduremap_class.md) | |\n\nFunctions\n---------\n\n| Function | Description |\n|-----------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [allProcedures(root)](./blockly.procedures_namespace.allprocedures_1_function.md) | Find all user-created procedure definitions in a workspace. |\n| [findLegalName(name, block)](./blockly.procedures_namespace.findlegalname_1_function.md) | Ensure two identically-named procedures don't exist. Take the proposed procedure name, and return a legal name i.e. one that is not empty and doesn't collide with other procedures. |\n| [flyoutCategory(workspace, useXml)](./blockly.procedures_namespace.flyoutcategory_1_function.md) | |\n| [flyoutCategory(workspace, useXml)](./blockly.procedures_namespace.flyoutcategory_2_function.md) | |\n| [getCallers(name, workspace)](./blockly.procedures_namespace.getcallers_1_function.md) | Find all the callers of a named procedure. |\n| [getDefinition(name, workspace)](./blockly.procedures_namespace.getdefinition_1_function.md) | Find the definition block for the named procedure. |\n| [isNameUsed(name, workspace, opt_exclude)](./blockly.procedures_namespace.isnameused_1_function.md) | Return if the given name is already a procedure name. |\n| [isProcedureBlock(block)](./blockly.procedures_namespace.isprocedureblock_1_function.md) | A type guard which checks if the given block is a procedure block. |\n| [mutateCallers(defBlock)](./blockly.procedures_namespace.mutatecallers_1_function.md) | When a procedure definition changes its parameters, find and edit all its callers. |\n| [rename(this, name)](./blockly.procedures_namespace.rename_1_function.md) | Rename a procedure. Called by the editable field. |\n\nInterfaces\n----------\n\n| Interface | Description |\n|--------------------------------------------------------------------------------|-----------------------------------------------------|\n| [IParameterModel](./blockly.procedures_namespace.iparametermodel_interface.md) | A data model for a procedure. |\n| [IProcedureBlock](./blockly.procedures_namespace.iprocedureblock_interface.md) | The interface for a block which models a procedure. |\n| [IProcedureMap](./blockly.procedures_namespace.iproceduremap_interface.md) | |\n| [IProcedureModel](./blockly.procedures_namespace.iproceduremodel_interface.md) | A data model for a procedure. |\n\nVariables\n---------\n\n| Variable | Description |\n|---------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [CATEGORY_NAME](./blockly.procedures_namespace.category_name_variable.md) | String for use in the \"custom\" attribute of a category in toolbox XML. This string indicates that the category should be dynamically populated with procedure blocks. See also Blockly.Variables.CATEGORY_NAME and Blockly.VariablesDynamic.CATEGORY_NAME. |\n| [DEFAULT_ARG](./blockly.procedures_namespace.default_arg_variable.md) | The default argument for a procedures_mutatorarg block. |\n\nType Aliases\n------------\n\n| Type Alias | Description |\n|------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------|\n| [ProcedureTuple](./blockly.procedures_namespace.proceduretuple_typealias.md) | Legacy means of representing a procedure signature. The elements are respectively: name, parameter names, and whether it has a return value. |"]]