Expose an action as a property
An action can be exposed as property if it does not accept any parameter. This can be done by setting the following properties on CommandPkg.
Action property values
- property_name
- The name of the property, unique at action level, in auto-complete box this name would appear.
- property_description
- A description of the property.
- property_type
- The data type on which property operates, only if the type matches, the property will be appear in the auto-complete box.
- property_return_type
- The data type for what property returns. If this type does not match with the field type where it is used, there will be validation error.
@BotCommand
@CommandPkg(label = "Uppercase", name = "uppercase", description="Converts the source string to upper case.",
icon = "uppercase.svg", node_label="Convert {{sourceString}} to upper case| and assign the result to {{returnTo}}|",
return_type=DataType.STRING, return_required = true, return_label="Assign the output to variable",
property_name="uppercase", property_description="Converts the string to upper case", property_type=DataType.STRING,
property_return_type=DataType.STRING) public class UpperCase {
@Execute
public Value<String> convert(
@Idx(index = "1", type=TEXT)
@Pkg(label="Source string")
@NotEmpty
String sourceString){
return new StringValue(sourceString.toUpperCase());
}
}