Automation Anywhere 설명서 읽기 및 검토

Automation 360

콘텐츠 닫기


콘텐츠 열기

Add a condition in a custom package for If condition

  • 업데이트: 2022/05/19
    • Automation 360 v.x
    • 구축
    • RPA Workspace

Add a condition in a custom package for If condition

Add conditions in a custom package.

Create condition values in an Action

  • To create a condition, set commandType property of BotCommand annotation with value as Condition.
  • To define the entry method of the condition, use the annotation ConditionTest.
@BotCommand(commandType = Condition)
@CommandPkg(label = "File exists", name = "fileExists",
        description = "Checks if the file exists.",
        node_label = "file exists at {{sourceFilePath}}", icon = "")
public class Exist extends AbstractCondition {
    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) {
        // Add the logic to check for the condition

The following example verifies if the provided boolean value is false.

Set commandType to Condition.

@BotCommand(commandType = Condition)
@CommandPkg(label = "False condition example", name = "conditionalTypeExample",
        description = "Checks if the boolean value is false.")
public class ConditionalTypeExample {
	    public Boolean validate(
	            @Idx(index = "1", type = AttributeType.BOOLEAN)
	            @Pkg(label = "Boolean variable", default_value_type = BOOLEAN) @NotEmpty Boolean variable
	    ) {
	        return variable == null ? false : !variable ;
피드백을 보내주십시오