작업에서 값을 리턴
CommandPkg에서 다음 특성을 설정하여 작업 출력을 변수에 저장합니다.
작업 리턴 값
- return_type
- 작업의 리턴 유형을 정의합니다. 이는 일반적으로 입력 방법의 리턴 유형과 일치합니다.
- return_required
- 참으로 설정된 경우 반환값이 필요합니다.
- return_label
- 변수가 값을 저장하도록 요청할 때의 UI 라벨입니다.
@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());
}
}
}