String Operations
Introduction
The WeHub Dashboard offers a variety of plugins to enhance and automate your workflows. These plugins are categorized into three types: Triggers, Processors, and Apps. This documentation provides an overview of the "String Operations" plugin, which falls under the Processors category.
String Operations Plugin
The "String Operations" plugin is used to handle various string manipulations within your workflow. This plugin provides four actions: Replace, Compress, Decompress, and Convert. Each action has specific configuration requirements.
Actions
1. Replace
Replace a token in a string with a specified value.
Configuration for Replace
- Label: A descriptive label to identify this action within your workflow.
- Config: Input the configuration for the replacement.
- Token: Input the token to be replaced. Users can add multiple tokens as needed.
Configuration Steps for Replace
- Label: Provide a meaningful label for this action. For example, "Replace Token in String".
- Config: Input the configuration details for the replacement.
- Token: Input the token to be replaced. Click "Add" to add more tokens as needed.
Example Configuration for Replace
Configuration Fields:
- Label: Replace Token in String
- Config: {"replace": "newValue"}
- Token: oldValue
Example Usage for Replace
Let's consider a scenario where you want to configure the Replace action to replace a token in a string with a new value.
Configuration Input:
- Label: Replace Token in String
- Config: {"replace": "newValue"}
- Token: oldValue
2. Compress
Compress a string.
Configuration for Compress
- Label: A descriptive label to identify this action within your workflow.
Configuration Steps for Compress
- Label: Provide a meaningful label for this action. For example, "Compress String".
Example Configuration for Compress
Configuration Fields:
- Label: Compress String
Example Usage for Compress
Let's consider a scenario where you want to configure the Compress action to compress a string.
Configuration Input:
- Label: Compress String
3. Decompress
Decompress a string.
Configuration for Decompress
- Label: A descriptive label to identify this action within your workflow.
Configuration Steps for Decompress
- Label: Provide a meaningful label for this action. For example, "Decompress String".
Example Configuration for Decompress
Configuration Fields:
- Label: Decompress String
Example Usage for Decompress
Let's consider a scenario where you want to configure the Decompress action to decompress a string.
Configuration Input:
- Label: Decompress String
4. Convert
Convert a string to a specified type.
Configuration for Convert
- Label: A descriptive label to identify this action within your workflow.
- Inputs: Users can add multiple inputs as needed by clicking on the "Add" button. Each input requires the following configurations:
- Name: Input the name.
- Type: Select the type (Types are: INT32, INT64, FLOAT32, DOUBLE, STRING, BYTE, DATE, DATETIME, BOOLEAN, OBJECT, ARRAY, ANY).
Configuration Steps for Convert
- Label: Provide a meaningful label for this action. For example, "Convert String to Integer".
- Inputs: Click on the "Add" button and provide the following configurations for each input:
- Name: Input the name.
- Type: Select the type from INT32, INT64, FLOAT32, DOUBLE, STRING, BYTE, DATE, DATETIME, BOOLEAN, OBJECT, ARRAY, ANY.
Example Configuration for Convert
Configuration Fields:
- Label: Convert String to Integer
- Input #1:
- Name: inputValue
- Type: INT32
Example Usage for Convert
Let's consider a scenario where you want to configure the Convert action to convert a string to an integer.
Configuration Input:
- Label: Convert String to Integer
- Input #1:
- Name: inputValue
- Type: INT32
Conclusion
The String Operations plugin in the WeHub Dashboard is a versatile tool for managing various string manipulations within your workflows. By configuring the label, inputs, and other specific settings, you can efficiently handle string replacements, compressions, decompressions, and conversions in various scenarios. Ensure to test and validate your configurations to achieve the desired workflow behavior.
If you have any further questions or need additional assistance, please refer to the WeHub Dashboard support documentation or contact our support team.