Setting System Parameters
Scenario
You can configure parameters related to environments and services as system parameters. Huawei Cloud Astro Zero provides a unified page for system parameter maintenance and management. If you change the value of a system parameter, the value will be updated in all places where the system parameter is referenced.
For example, the built-in system parameter bingo.expiretask.execute.time preset by Huawei Cloud Astro Zero indicates the time when the system executes the data deletion task. When executing a data deletion task, the system automatically queries the value of this parameter. After the value is found, the system starts the data deletion task based on the configured time. You can also customize system parameters, which can be used in scripts, flows, BPMs, and data access. For details about how to use system parameters, see Using System Parameters.
This section details the configuration of system parameters in two settings: the environment configuration and the application development workbench (see Figure 1). Parameters set in the workbench are packaged and released with the application, meaning they are automatically included in the runtime environment without the need for reconfiguration. In contrast, parameters configured in the environment configuration are not included in application releases.
Setting System Parameters
- Log in to the Huawei Cloud Astro Zero console and click Access Homepage. The application development page is displayed.
- In the upper left corner of the page, click
and choose Environments > Environment Configuration.
- In the navigation pane, choose System Settings > System Parameters.
- (Optional. Perform this step when you need to modify parameters.) Search for the system parameter to be modified, click the parameter name, and change the parameter value on the parameter details page.
- System Parameters: displays custom system parameters. You can add, delete, and modify these parameters.
- Built-in System Parameters: displays preset system parameters. You can only change the values of preset system parameters but cannot delete preset system parameters.
- (Optional. Perform this step when you need to customize parameters.) Create a system parameter.
- On the System Parameters tab page, click New.
- Complete the configuration, and click New.
Using System Parameters
During application development, you can import system parameters set in the environment configuration. Once imported, these parameters are available for use. This section uses application A to demonstrate the import process of system parameters.
- Access the application designer of application A by referring to Logging In to the Application Designer.
- In the navigation pane, choose Logic and choose More > System Parameter.
- Click Import and select the system parameters created in the environment configuration page.
- Use system parameters in scripts, flows, or BPMs.
- Scripts: In a script, introduce the sys library and enter sys.getParameter('System parameter name').
For example, edit the following code in a script, and execute the script without entering input parameters. Then view the printed logs on the log page.
import * as sys from 'sys'; let sysParam = sys.getParameter('Namespace__APPName_MaxValue'); console.log("MaxValue:", sysParam);
Figure 2 Importing system parameters to a script
- Flows: On the flow configuration page, click the context icon, click the plus (+) sign next to Formula, and enter SYSPARAMETER('System parameter name').
Figure 3 Importing system parameters to a flow
- BPMs: On the BPM configuration page, click the context icon, and click the plus (+) sign next to Variable to add the same type of variable. Then enter SYSPARAMETER('System parameter name') for Value on the Assignment Details page.
Figure 4 Importing system parameters to a BPM
- Custom connectors: On the Action tab page of a custom connector, click New. In URL of the New Action page, use the {!System parameter name} format to import the system parameter.
Figure 5 Importing system parameters to a custom connector
- Scripts: In a script, introduce the sys library and enter sys.getParameter('System parameter name').
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot