Automate the data upload

If you are working on a Windows environment you can use the Windows Task Scheduler in order to automate the data upload. In order to achieve this, you should follow these steps:

Step 1 - Create a bat file

You should create a bat file in order to call the command line procedure generated in Updating data

For example, if your Knowledge Base is generated in Java, the bat file would be similar to:

cd C:\Models\PruebasBI\KBJavaTest\JavaMySQL006\Web

java -cp "java -cp "gxclassR.jar; gxcommon.jar; gxcryptocommon.jar;gxmail.jar;javapns.jar;gxsearch.jar;gxoffice.jar;
C:\Program Files\Apache Software Foundation\Tomcat 9.0\lib\servlet-api.jar;.\drivers\BIPlusUpload.jar; .\drivers\httpclient-4.5.4.jar;
.\drivers\httpcore-4.4.7.jar;.\drivers\httpmime-4.5.4.jar; .\drivers\jackson-annotations-2.9.3.jar;.\drivers\jackson-core-2.9.2.jar;
 .\drivers\jackson-databind-2.9.3.jar;.\drivers\java-jwt-3.4.0.jar;.\drivers\jt400.jar;.\drivers\jtds-1.2.jar;
.\drivers\mysql-connector-java-5.1.47.jar;.\drivers\ojdbc6.jar; .\drivers\postgresql-42.2.5.jre6.jar;.\drivers\sqlitejdbc-v056.jar;
bcprov-jdk15on-1.60.jar;bcpkix-jdk15on-1.60.jar;xmlsec-2.1.2.jar; jdom-2.0.0.jar;commons-logging-1.0.4.jar;commons-io-2.2.jar;
xml-apis-1.4.01.jar;activation-1.1.jar;gxgeospatial.jar; gxexternalproviders.jar;. ;jackson-annotations-2.9.8.jar;javax.ws.rs-api-2.0.1.jar;
simple-xml-2.7.1.jar; jackson-core-2.9.8.jar;jersey-media-json-jackson-2.22.2.jar;xercesImpl.jar; lucene-core-2.2.0.jar;itext-2.1.7.jar;
commons-lang-2.4.jar;commons-codec-1.11.jar;joda-time-2.8.2.jar;spatial4j-0.6.jar;jts-1.14.jar; jtsio-1.14;noggit-0.5.jar;
GeographicLib-Java-1.49.jar;jackson-databind-2.9.8.jar;xmlbeans.jar;poi.jar;poi-ooxml.jar; poi-ooxml-schemas.jar;
commons-collections4-4.1.jar;wss4j-1.6.19.jar;xalan-2.7.2.jar;serializer-2.7.2.jar;slf4j-api-1.7.7.jar;
slf4j-nop-1.7.7.jar; log4j-core-2.11.2.jar;log4j-api-2.11.2.jar;javax.mail-1.6.2.jar;.\modules\GeneXus.jar;
.\services\GXWebSocket.jar; BIPlusUpload.jar;java-jwt-3.4.0.jar; jackson-core-2.9.2.jar;jackson-databind-2.9.3.jar;
jackson-annotations-2.9.3.jar;httpclient-4.5.4.jar;httpcore-4.4.7.jar; httpmime-4.5.4.jar" com.kbjavatest.abusinessintelligenceplusuploaddata

You can download a .bat example from here.

Step 2 - Create the task in the Task Scheduler

Create a default task by following these steps: https://docs.microsoft.com/en-us/windows/desktop/taskschd/task-scheduler-1-0-examples

While defining the task you should use the bat file generated in the previous step:

AutomatiseImg2

You can define when the task is going to be triggered according to your business needs.

You can download a sample task from here.  In this example, the upload process will be executed daily at 7:00 pm. This task can be imported while creating a new task in the Windows Scheduler so you will have a ready-to-use sample task.

Using the Windows Task Scheduler is just an example so you can see how easy is to automate the data update, but you can also do it by creating a script or using any other task automation tool.