Class QMenuItemRunProcess
java.lang.Object
com.kingsrook.qqq.backend.core.model.metadata.menus.items.QMenuItemBase
com.kingsrook.qqq.backend.core.model.metadata.menus.items.QMenuItemRunProcess
- All Implemented Interfaces:
QMenuItemInterface,QMetaDataObject,Serializable,Cloneable
Menu item that triggers the execution of a QQQ process.
This menu item type is used to provide menu-driven access to processes defined in the QQQ application. When selected, it will execute the specified process.
The label and icon for this menu item can be automatically derived from the process's metadata if not explicitly set.
The process must be associated with the same table that contains this menu item.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.QMenuItemRunProcess(String processName) Constructor that initializes the run process item with a process name. -
Method Summary
Modifier and TypeMethodDescriptionclone()Creates and returns a shallow copy of this run process menu item.getIcon()Returns the icon for this menu item, automatically deriving it from the process's metadata if not explicitly set.Returns the item type identifier for run process menu items.getLabel()Returns the label for this menu item, automatically deriving it from the process's metadata if not explicitly set.Getter for processNameReturns the values map containing the process name.voidsetProcessName(String processName) Setter for processNamevoidvalidate(QInstanceValidator validator, QInstance qInstance, QMetaDataObject parentObject) Validates that the run process menu item has a valid process name and that the process exists and is associated with the correct table.withProcessName(String processName) Fluent setter for processNameMethods inherited from class com.kingsrook.qqq.backend.core.model.metadata.menus.items.QMenuItemBase
setIcon, setLabel, withIcon, withLabel
-
Constructor Details
-
QMenuItemRunProcess
public QMenuItemRunProcess()Default constructor. -
QMenuItemRunProcess
Constructor that initializes the run process item with a process name.- Parameters:
processName- the name of the process to execute
-
-
Method Details
-
getLabel
Returns the label for this menu item, automatically deriving it from the process's metadata if not explicitly set.If no label has been set on this menu item, this method attempts to retrieve the label from the process's metadata and sets it automatically.
- Specified by:
getLabelin interfaceQMenuItemInterface- Overrides:
getLabelin classQMenuItemBase- Returns:
- the label for this menu item
- See Also:
-
getIcon
Returns the icon for this menu item, automatically deriving it from the process's metadata if not explicitly set.If no icon has been set on this menu item, this method attempts to retrieve the icon from the process's metadata and sets it automatically.
- Specified by:
getIconin interfaceQMenuItemInterface- Overrides:
getIconin classQMenuItemBase- Returns:
- the icon for this menu item, or null if none is available
- See Also:
-
getItemType
Returns the item type identifier for run process menu items.- Returns:
- always returns "RUN_PROCESS"
-
getValues
Returns the values map containing the process name.- Returns:
- a map containing the process name under the key "processName"
-
getProcessName
-
setProcessName
-
withProcessName
Fluent setter for processName- Parameters:
processName- The name of the process to run. Required to be a valid process in the instance, and associated with the table in which this menu item is defined (via process.tableName).- Returns:
- this
-
validate
public void validate(QInstanceValidator validator, QInstance qInstance, QMetaDataObject parentObject) Validates that the run process menu item has a valid process name and that the process exists and is associated with the correct table.Ensures that:
- A process name is specified
- The process exists in the QQQ instance
- The process is associated with the same table as the menu item (if parent is a QTableMetaData)
- Parameters:
validator- the validator instance to use for reporting errorsqInstance- the QQQ instance being validatedparentObject- the parent metadata object containing this menu item
-
clone
Creates and returns a shallow copy of this run process menu item.- Specified by:
clonein interfaceQMenuItemInterface- Overrides:
clonein classQMenuItemBase- Returns:
- a clone of this menu item
-