[JAVA] Create a package that is a common development component of Automation Anywhere A2019 # 1-First, build and use the SDK sample as it is

In Automation Anywhere A2019, you can streamline bot creation by creating and distributing common development parts called "packages". Let's summarize the outline while referring to the content explained in Developer Meetup Vol.2 sponsored by Automation Anywhere held online the other day. I did. Since the package is built using Java technology, we will prepare the Java build environment for development.

The following are used as the environment.

** Articles in the "Creating a Package, a Common Development Part of Automation Anywhere A2019" series **

Package development for adding actions to the bot build screen

You can add your own actions to the action panel as shown in the screen below. You can also set the action icon and the input / output arguments of the action.

image.png Source: Developer Meetup Vol.2 sponsored by AA

Package development is carried out according to the following flow.

Installation of Java integrated environment IntelliJ IDEA Community Edition

Next, set up the Java IDE. Product Documentation specifies Eclipse or IntelliJ Community Edition So I'm going to use IntelliJ here.

Please visit the JetBrains page below to download and install the "community" version of the .exe. When you press the .exe button, you will be prompted to enter your email address, but if you do not enter it, the download will start automatically, so you do not have to enter it. https://www.jetbrains.com/ja-jp/idea/download/ image.png

It is OK if you can download the following .exe of about 550MB. (idealC-XXXX.X.X.exe, the number in the X part may be different with each version.) image.png

Also, although the IDE is in basic English, it seems that the beta version in Japanese is also being tested, so if you are interested, please download and install it. This is a .jar file of about 1.5MB, which can be seamlessly integrated and installed by setting it up after installing the IDE.

Reference article: "[Starting the IDE and obtaining and installing the Japanese localization plug-in](https://qiita.com/RPAbot/items/282d859344d1e96a953f#ide%E3%81%AE%E8%B5%B7%E5%" 8B% 95% E3% 81% A8% E6% 97% A5% E6% 9C% AC% E8% AA% 9E% E5% 8C% 96% E3% 83% 97% E3% 83% A9% E3% 82% B0% E3% 82% A4% E3% 83% B3% E3% 81% AE% E5% 85% A5% E6% 89% 8B% E3% 82% A4% E3% 83% B3% E3% 82% B9% E3% 83% 88% E3% 83% BC% E3% 83% AB) ”

Installation steps

Run idealC-XXXX.X.X.exe and answer "yes" to "Allow apps to make changes to your device". image.png

Click the Next button on the first screen. image.png

Click the "Next" button. image.png

Check File Association if necessary. Click the "Next" button. image.png

Click the "Install" button. image.png

The installation will proceed, so just wait. image.png

Click the "Finish" button. This completes the installation. image.png

Open the SDK file in the Java IDE

SDK file A2019-package-sdk.2.0.1.zip in advance Download it and unzip it to any location on your computer. In recent versions, it seems that the multilingual function of the UI has been added. image.png

When you open the Windows Start menu, you should see IntelliJ in "Recently Added", so click it to open the IntelliJ IDE. image.png

If the following dialog box is displayed, just click the "OK" button. image.png

The first time you will be asked if you want to customize it, so click "Skip ...". image.png

Click Open or Import. image.png

Select the folder where you unzipped the contents of the zip file. Click the "OK" button. image.png

Then such a screen will open. image.png

JDK download

Now, in the build log panel at the bottom of the screen, I see the error "Invalid Gradle SDK configuration found". This is displayed because you have not yet installed the appropriate JDK. Click Open Gradle Settings. image.png

Then, the same screen as when "File"-"Settings ..." is specified opens. The Gradle JVM is "", so click "Download JDK ..." in the dropdown. image.png

Since it is said that version 11 is required for the JDK, specify 11 of Azul Zulu Community, which is also used in Automation Anywhere. If you specify the "Download" button, the download will start in the specified location. image.png

By the way, in the case of IntelliJ, the build is not done from the IDE's "Build" command, but by calling gradelew.bat from the Terminal on the command line. (Eclipse seems to be able to compile from the IDE.) In the case of IntelliJ, it seems that it does not fully support building using Gradle.

Therefore, after installing the JDK, you need to specify the root folder of the JDK in the environment variable JAVA_HOME. In this example

set JAVA_HOME=C:\Users\(User name)\.jdks\azul-11.0.7

And set it as.

Build package (command line)

After setting the environment variable JAVA_HOME from Terminal in the IDE, execute the build command gradlew.bat clean build shadow Jar. Then the build will start. image.png

There may be warnings and cautions along the way, but the build will be completed as follows.

D:\AASDK\A2019-package-sdk-2.0.1>gradlew.bat clean build shadowJar
Downloading https://services.gradle.org/distributions/gradle-5.4.1-bin.zip
...................................................................................

Welcome to Gradle 5.4.1!

Here are the highlights of this release:
 - Run builds with JDK12
 - New API for Incremental Tasks
 - Updates to native projects, including Swift 5 support

For more details see https://docs.gradle.org/5.4.1/release-notes.html

Starting a Gradle Daemon (subsequent builds will be faster)

> Task :compileJava
...

> Task :commandCodeGen
mergeJsonFiles: updatePackage: group com.automationanywhere , artifactName A2019DemoPackage , packageVersion 2.0.1-20200607-015603

BUILD SUCCESSFUL in 51s
6 actionable tasks: 5 executed, 1 up-to-date
D:\AASDK\A2019-package-sdk-2.0.1>

When the build is complete, the compiled file (.jar file) is output to (project folder) \ build \ libs. image.png

Uploading packages to Control Room

If you have permission to add packages to the Control Room, you can use the "Add Package ..." menu under "Bot"-"Packages". image.png

Specify the .jar file you built earlier as the "upload package". Then click the "Upload Package" button. image.png

You can see that this package contains 28 actions. You can preview the contents. To enable it as is, click the "Approve, Enable, Set as Default" button. image.png

Now you can use it as a package from the bot construction screen.

Try using the package from the bot construction screen

On the Bot construction screen, "A2019 Demo Package" has been added to the action palette, and 28 actions have been added below it. If you try to incorporate the action into the flow, you can see that arguments etc. are also specified in the details of each action. image.png

in conclusion

How was it! ?? By now, you should have built the build environment, built the SDK sample file as it is, uploaded it to the Control Room, and confirmed the procedure to use it.

In the sequel, we'll finally see what's inside the SDK sample and how to edit it to create your own package!

Series of this article

Reference material

Recommended Posts

Create a package that is a common development component of Automation Anywhere A2019 # 1-First, build and use the SDK sample as it is
[Quarkus] A trap that doesn't work even if you copy and paste the GCP Pub / Sub sample as it is
Create a Yellowfin custom formatter and display the minus of the number as △ (triangle)
The end of catastrophic programming # 03 "Comparison of integers, if" a> b ", assume that it is" a --b> 0 ""
It is difficult to use the empty string or date of DBUnit, so fix it and use it.
[Docker] Is it good enough to call it a multi-stage build? → The story that became so good