If 조건에 대한 맞춤형 패키지에서 조건을 추가합니다.
맞춤형 패키지에서 조건을 추가합니다.
Action에서 조건 값을 생성합니다.
- 조건을 생성하려면 BotCommand 주석 기호의 commandType 특성을 값과 함께 조건으로 설정합니다.
- 조건의 입력 방법을 정의하려면 ConditionTest 주석 기호를 사용합니다.
@BotCommand(commandType = Condition)
@CommandPkg(label = "File exists", name = "fileExists",
description = "Checks the file exists condition.",
node_label = "file exists at {{sourceFilePath}}", icon = "")
public class Exist extends AbstractCondition {
@ConditionTest
public boolean test(@Idx(index = "1", type = FILE) @LocalFile @Pkg(label = "File path") @NotEmpty String sourceFilePath,
@Idx(index = "2", type = NUMBER) @Pkg(label = "How long you would like to wait for this condition
to be true?(Seconds)",
default_value = "0", default_value_type = DataType.NUMBER)
@GreaterThanEqualTo("0") @LessThanEqualTo("99999") @NotEmpty @NumberInteger Double waitTimeout) {
// Logic to check for the condition goes here
}
}