Automation Anywhere

Automation Anywhere Automation 360

關閉內容

內容

開啟內容

從動作傳回值

  • 已更新:4/15/2021
    • Automation 360 v.x
    • 建立
    • RPA 工作區

從動作傳回值

CommandPkg 上設置以下屬性 ,以將操作輸出存儲在變量中。

操作返回值

  • return_type

    定義操作的返回類型。它通常與條目方法返回類型匹配。

  • RETURE_REQUIRED

    當值設置爲 true 時,需要返回值。

  • Return_label

    變量值的 UI 標籤說明。

範例: 將 sourceString 轉換爲大寫,並將結果分配給 return
//BotCommand makes a class eligible for being considered as an action.
@BotCommand

//CommandPks adds required information to be displayable on the UI.
@CommandPkg(
		//Unique name inside a package and label to display.
		name = "uppercase", label = "[[Uppercase.label]]",  
		node_label = "[[Uppercase.node_label]]",  description = "[[Uppercase.description]]", icon = "pkg.svg", 
		
		//Return type information. return_type ensures only the right kind of variable is provided on the UI. 
		return_label = "[[Uppercase.return_label]]", return_type = STRING, return_required = true)
public class Uppercase {
	
	//Messages read from a fully qualified property file name and provides i18n capability.
	private static final Messages MESSAGES = MessagesFactory
			.getMessages("com.automationanywhere.botcommand.samples.messages");

	//Identify the entry point for the action. Returns a Value <String> because the return type is String. 
	@Execute
	public Value<String> action(
			//Idx 1 would be displayed first, with a text box for entering the value.
			@Idx(index = "1", type = TEXT) 
			//UI labels.
			@Pkg(label = "[[Uppercase.sourceString.label]]") 
			//Ensure that a validation error is thrown when the value is null.
			@NotEmpty 
			String sourceString,
傳送意見反饋