패키지 SDK를 사용하여 조건 생성
- 최종 업데이트2022/05/19
Automation 360를 사용할 때 SDK 패키지로 조건을 만들 수 있습니다.
조건 사용
If 및 루프는 Automation 360에서 구성체를 분기합니다. 조건이 true
로 설정된 경우 일련의 작업을 실행하는 데 사용됩니다. 조건은 If 및 루프 패키지와 함께 사용됩니다. 조건이 입력 세트를 가져와 부울 값을 반환합니다.
필요한 주석 기호
조건을 생성하려면 다음 주석 기호가 필요합니다.
사용 사례 예시
다음 사용 사례는 주어진 번호가 다른 번호보다 큰지 여부를 확인합니다.
- 비즈니스 로직을 사용하여 POJO 클래스를 만듭니다.
public class IsGreater { public Boolean checkGreater(Double first, Double checkAgainst) { return first > checkAgainst; } }
- POJO 클래스에 주석 기호를 지정하여 Automation 360 조건에 대해 이를 활성화하고 패키지를 만듭니다.
@BotCommand(commandType = Condition) @CommandPkg(label = "Is greater condition", name = "IsGreater", description = "Checks if the given number is greater than the other.", node_label = "{{first}} > {{checkAgainst}} ") public class IsGreater { public Boolean checkGreater(Double first, Double checkAgainst) { return first > checkAgainst; } }
checkGreater
메소드에 주석을 달아 이 메소드를 비교 방법으로 사용해야 함을 나타냅니다.@ConditionTest public Boolean checkGreater(Double first, Double checkAgainst) { return first > checkAgainst; }
모든 조건에는 정확히 하나의 테스트 조건 방법이 있어야 합니다.
checkGreater
메소드의 매개변수에Idx
및Pkg
주석을 답니다.@NotEmpty
를 추가하여 값이 null이 아닌지 확인합니다.@ConditionTest public Boolean checkGreater( @Idx(index = "1", type = AttributeType.NUMBER) @Pkg(label = "Number to check") @NotEmpty Double first, @Idx(index = "2", type = AttributeType.NUMBER) @Pkg(label = "Number to compare against") @NotEmpty Double checkAgainst) { return first > checkAgainst; }
속성 유형 숫자는
Double
로 반환합니다.