Hi, I'm trying to import com.novayre.jidoka.outlook.api to use Outlook Module. In Appian documentation there is a page dedicated (https://docs.appian.com/suite/help/20.1/rpa/modules/ms-outlook-module.html but I don't understand how to import this library on my robot java class. If I type import com.novayre.jidoka.outlook.api, java not recognize it. How can I use this and other classes of javadoc?
Second question: I need to include this dependency in pom.xml
<dependency> <groupId>com.novayre.jidoka.module</groupId> <artifactId>jidoka-msoutlook-api</artifactId> <version>${jidoka.version}</version> </dependency>
Where I can find ${jidoka.version}? The Appian docs site says that I can find the version number in the pom.xml in this node:
<properties> <jidoka.version>X.Y.Z</jidoka.version> </properties>
but in the pom.xml that is generated by Appian console there aren't the node <properties>. Thanks, I hope the questions to these answers will also help other early developers like me.
Discussion posts and replies are publicly visible
Your pom.xml file should have a reference to the parent file like this:
<parent> <groupId>com.novayre.jidoka.robot</groupId> <artifactId>jidoka-robot-parent</artifactId> <version>7.0.0</version> </parent>
It is in this parent file, where the <jidoka.version> property is declared.
<jidoka.version>7.0.0</jidoka.version>
Therefore, if you have a defined the parent file, you should be able to include dependency
<dependency> <groupId>com.novayre.jidoka.module</groupId> <artifactId>jidoka-msoutlook-api</artifactId> <version>${jidoka.version}</version></dependency>
without problems.
Only after include the dependency, your should be able to use the package com.novayre.jidoka.outlook.api.
Do you have a problem compiling the project?
Thank you, I have solved this problem now. I'm trying to continue, for now I have done a class that opens and closes outlook. I inserted the dll jacob-1.19-x64.dll inside the same folder where the agent is located on the resource, but when I try to perform the robotic process, from the Execution Log I see that it freezes, so it is even an hour!
The code is this:
pom.xml
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.novayre.jidoka.robot.test</groupId> <artifactId>OutlookTest</artifactId> <packaging>jar</packaging> <version>0.0.1</version> <name>Outlook Test Robot</name> <properties> <jidoka.version>7.0.0</jidoka.version> </properties> <parent> <groupId>com.novayre.jidoka.robot</groupId> <artifactId>jidoka-robot-parent</artifactId> <version>7.0.0</version> <!-- VC --> </parent> <profiles> <profile> <id>jidoka-repo</id> <activation> <activeByDefault>true</activeByDefault> </activation> <repositories> <repository> <id>jidoka</id> <url>https://domain.appiancloud.com/rpa-repo/repository/jidoka/</url> <releases> </releases> <snapshots> </snapshots> </repository> </repositories> <pluginRepositories> <pluginRepository> <id>jidoka</id> <url>https://domain.appiancloud.com/rpa-repo/repository/jidoka/</url> <releases> </releases> <snapshots> </snapshots> </pluginRepository> </pluginRepositories> <distributionManagement> <repository> <id>jidoka</id> <url>https://domain.appiancloud.com/rpa-repo/repository/jidoka/</url> <layout>default</layout> </repository> </distributionManagement> </profile> </profiles> <dependencies> <dependency> <groupId>com.novayre.jidoka.module</groupId> <artifactId>jidoka-msoutlook-api</artifactId> <version>${jidoka.version}</version> </dependency> </dependencies> </project>
Java class:
package com.novayre.jidoka.robot.test; import com.novayre.jidoka.client.api.IJidokaServer; import com.novayre.jidoka.client.api.IRobot; import com.novayre.jidoka.client.api.JidokaFactory; import com.novayre.jidoka.client.api.annotations.Robot; import com.novayre.jidoka.client.api.exceptions.JidokaFatalException; import com.novayre.jidoka.client.api.multios.IClient; import com.novayre.jidoka.outlook.api.IJidokaOutlook; import com.novayre.jidoka.outlook.api.exception.JidokaMsOutlookException; /** * The Class OutlookTestRobot. */ @Robot public class OutlookTestRobot implements IRobot { /** * Pause between interactions imitating the human behavior. */ private static final int PAUSE = 5000; /** The server. */ private IJidokaServer< ? > server; /** The client. */ private IClient client; IJidokaOutlook outlook = IJidokaOutlook.getInstance(this); /** * Initialize the modules */ @Override public boolean startUp() throws Exception { // Initialization of the robot components server = JidokaFactory.getServer(); client = IClient.getInstance(this); return IRobot.super.startUp(); } @Override public String[] cleanUp() throws Exception { client.killAllProcesses("outlook.exe", 1000); return new String[0]; } /** * Initial action 'Init'. */ public void init() { try { // Default pause after typing or using the mouse client.typingPause(PAUSE); client.mousePause(PAUSE); } catch (Exception e) { throw new JidokaFatalException("Error initializing"); } } public void openOutlook() throws Exception { try { outlook.open(); client.pause(PAUSE); } catch (JidokaMsOutlookException e) { throw new JidokaFatalException("Error opening Outlook"); } } public void closeOutlook() { try { outlook.close(); } catch (JidokaMsOutlookException e) { throw new JidokaFatalException("Error closing Outlook"); } } /** * End. */ public void end() { server.debug("Robot finished!"); } }
The problem is that the initialization of the outlook class is done outside of a method.
Please declare only the variable :
IJidokaOutlook outlook;
And initialize outlook in the startUp() method:
outlook = IJidokaOutlook.getInstance(this);
When the startUo() method is executed, the robot (the this parameter) is already correctly initialized.
Thank you, I now have this error:
[INFO] 2020-06-16 12:13:31 - - Robot 'OutlookTest' (5ee88089e4b0a11cc6ffa5c7), execution #6, technology JAVA, start method CONSOLE , log level TRACE, testing mode is ON, external workflow is OFF, user myemail@domain.com, preferred node is Antonio W10 (5eb2e8afe4b0a11cc6ffa53b#1)[INFO] 2020-06-16 12:13:31 - - Robot without instructions[INFO] 2020-06-16 12:13:31 - - Robot without environment variables[INFO] 2020-06-16 12:13:31 - - Waiting for Antonio W10 (5eb2e8afe4b0a11cc6ffa53b#1) node[INFO] 2020-06-16 12:13:33 - - Node selected was Antonio W10 (5eb2e8afe4b0a11cc6ffa53b#1), permissions: test[INFO] 2020-06-16 12:13:33 - - Agent version 7.0.0, revision 20040307[INFO] 2020-06-16 12:13:33 - - Memory: free 16.284Mb, reserved 37Mb (1%), limit 1.975Gb, maximum 1.975Gb[INFO] 2020-06-16 12:13:33 - - Disk: free 80.366Gb (31%), total 255.154Gb[INFO] 2020-06-16 12:13:35 - - Processing libraries[INFO] 2020-06-16 12:13:35 - - Checking #73 libraries[INFO] 2020-06-16 12:13:36 - - Sending #1 of #1 libraries[INFO] 2020-06-16 12:13:37 - - Assembling class com.novayre.jidoka.robot.test.OutlookTestRobot version 0.0.1[INFO] 2020-06-16 12:13:40 - - Processing support files
[ERROR] 2020-06-16 12:13:45 - - java.lang.reflect.InvocationTargetException at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:564) at com.novayre.jidoka.client.RobotClientExecutor.invokeMethod(RobotClientExecutor.java:1537) at com.novayre.jidoka.client.RobotClientExecutor.robotStartUp(RobotClientExecutor.java:442) at com.novayre.jidoka.client.ETechnologyClient.internalRunJava(ETechnologyClient.java:392) at com.novayre.jidoka.client.ETechnologyClient.runJava(ETechnologyClient.java:375) at com.novayre.jidoka.client.ETechnologyClient.lambda$static$1(ETechnologyClient.java:40) at com.novayre.jidoka.client.ETechnologyClient.run(ETechnologyClient.java:117) at com.novayre.jidoka.client.RobotClientExecutor.tryExecute(RobotClientExecutor.java:354) at com.novayre.jidoka.client.RobotClientExecutor.execute(RobotClientExecutor.java:184) at com.novayre.jidoka.client.ResponseHandler.execute(ResponseHandler.java:292) at com.novayre.jidoka.client.ResponseHandler.robotDeclaredResponse(ResponseHandler.java:248) at com.novayre.jidoka.client.ResponseHandler.onMessage(ResponseHandler.java:145) at com.novayre.jidoka.client.ClientManager.processResponse(ClientManager.java:1519) at com.novayre.jidoka.client.ClientManager.internalSendCommandRetry(ClientManager.java:1297) at com.novayre.jidoka.client.ClientManager.internalSendCommand(ClientManager.java:1172) at com.novayre.jidoka.client.ClientManager.sendCommand(ClientManager.java:1013) at com.novayre.jidoka.client.ClientManager.sendCommand(ClientManager.java:999) at com.novayre.jidoka.client.ClientManager.loop(ClientManager.java:988) at com.novayre.jidoka.client.ClientManager.realConnectToServer(ClientManager.java:872) at com.novayre.jidoka.client.ClientManager.connectToServer(ClientManager.java:830) at com.novayre.jidoka.client.JidokaClient.connect(JidokaClient.java:948) at com.novayre.jidoka.client.JidokaClient.mainLoop(JidokaClient.java:532) at com.novayre.jidoka.client.JidokaClient.run(JidokaClient.java:518) at com.novayre.jidoka.client.JidokaClient.main(JidokaClient.java:363)Caused by: java.lang.NoClassDefFoundError: Could not initialize class com.jacob.activeX.ActiveXComponent at com.novayre.jidoka.outlook.impl.manager.OutlookApplication.<init>(OutlookApplication.java:67) at com.novayre.jidoka.outlook.impl.JidokaOutlook.<init>(JidokaOutlook.java:43) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500) at java.base/java.lang.reflect.ReflectAccess.newInstance(ReflectAccess.java:124) at java.base/jdk.internal.reflect.ReflectionFactory.newInstance(ReflectionFactory.java:346) at java.base/java.lang.Class.newInstance(Class.java:604) at com.novayre.jidoka.client.api.JidokaFactory.getInstance(JidokaFactory.java:197) at com.novayre.jidoka.client.api.JidokaFactory.getFreshInstance(JidokaFactory.java:151) at com.novayre.jidoka.client.api.JidokaFactory.getFreshInstance(JidokaFactory.java:107) at com.novayre.jidoka.outlook.api.IJidokaOutlook.getInstance(IJidokaOutlook.java:45) at com.novayre.jidoka.robot.test.OutlookTestRobot.startUp(OutlookTestRobot.java:43) ... 27 more
[INFO] 2020-06-16 12:13:46 - - Start of libraries cleanup[INFO] 2020-06-16 12:13:49 - - End of libraries cleanup[INFO] 2020-06-16 12:13:51 - - Start of robot cleanup[INFO] 2020-06-16 12:14:09 - - End of robot cleanup[INFO] 2020-06-16 12:14:09 - - Memory: free 13.402Mb, reserved 37Mb (1%), limit 1.975Gb, maximum 1.975Gb[INFO] 2020-06-16 12:14:09 - - Disk: free 80.366Gb (31%), total 255.154Gb[INFO] 2020-06-16 12:14:09 - - Memory difference: free -2.882Mb, reserved 0b (0%)[INFO] 2020-06-16 12:14:09 - - Disk difference: free 0b (0%)[INFO] 2020-06-16 12:14:09 - -****************************************************************************************************Total number of items: #0Result #Items----------------------------------------------------------------------------------------------------Result Duration #Index Item Key (Detail) [Properties]****************************************************************************************************