Today’s article comes from Joel Wiesmann, a friend of mine and an Automic expert from Switzerland, who already published an article here in the blog around a year ago.

In this article he tells us  about the ApplicationInterface API, Powershell and his new e-learning, where you learn to use both together.

As an Automation Engineer, I work a lot with JOBS objects. Every day, I see and create solutions with AE Script, Windows CMD, Perl, Bash and Powershell. Sometimes it’s simple tasks, sometimes more complex. The fact is, scripting languages accompany me day by day and my knowledge about it makes up a large part of my value in the working world.

Because of that, it has always annoyed me that my daily activities with the Automation Engine – like creating, copying and changing objects – could not be automated by means of my well-known and well-loved scripting languages.

Can you already guess what I’m going for? The ApplicationInterface is Automic’s own Java Library, with which the “old” fatclient was implemented. So, if you are looking for automation solutions for the Automation Engine, you will find almost exclusively Java-implemented programs.

It’s Some Stale Coffee

I’ve got some issues with Java.

I’m a scripter. I like transparent solutions that are developed quickly and do not need a development environment the size of an Oracle installation. Even if I overlook this and write my scripts around the Java programs – I have a break in the programming language. And this break will get visible once there are new requirements.

If programming with the ApplicationInterfaces in Java is the slow craft of brewing coffee, implementing it with Powershell is Nespresso.
Source: coffeegeek.tv

Let’s take the following fictional conversation between the Job creator Joe Job and the Java developer Jasmin Java:

Joe Job: “I want to export all objetcs from the file objects.txt.”

Jasmin Java: “Okay, use mytool.jar with the parameter -f objects.txt”

Joe Job: “… could we add a filter for the date? So, only the objects of the last 12h?”

Jasmin Java: “Okay, I added the -h parameter. ”

Joe Job: “… and if I only want the objects that are not on agent 2000?”

Jasmin Java: “Phew… -C ”

Joe Job: “Cool. Oh, and is the program also able to do imports?”

Jasmin Java: “…!!!!”

Does that sound familiar? Do you wish, you could write flexible solutions with a script language? Starting at the end of September 2017, PhilippElmer.com will provide you with an eLearning, which will teach you how to use Windows Powershell to address the ApplicationInterface API.

eLearning: WorkflowCommander Core

With this eLearning you will get:

  • WorkflowCommander Core – a Powershell Module with more than 20 ready-to-use Cmdlets to access and work with the AE
  • Descriptions and examples for the Cmdlets
  • Tips and tricks for the usage of the ApplicationInterface API an the Powershell
  • Workshops with entertaining hands-on examples
  • Six months of access to the course materials including updates for this time frame

You want an example? Here are some lines of Powershell code.

$ae = New-aeConnection -profile client1000

# Titel von JOB.WINDOWS anpassen
$obj = Open-aeObject -ae $ae -name JOB.WINDOWS -readwrite
$obj.header().setTitle("Neuer Objekttitel")
Save-aeObject -ae $ae -object $obj -close

# Neuen Ordner erstellen und Objekt reinschieben
New-aeFolder -ae $ae -path /DEMO/WFC_DEMO_OBJEKT -title "Mich gibts fuer den Blog."
Move-aeObject -ae $ae -name JOB.WINDOWS -path /DEMO/WFC_DEMO_OBJEKT

# Prüfen ob Objekt noch da ist 
$objectinfo = Get-aeObjectProperties -ae $ae -name JOB.WINDOWS
if ($objectinfo) {
  Write-Host "Wir sollten aufraeumen! Folgende Objekte sind noch in dem Ordner:"
  Search-aeObject -ae $ae -path $objectinfo.path -NonRecursiveSearch
}

# Objekt exportieren und löschen..
Export-aeObject -ae $ae -name JOB.WINDOWS -file C:\temp\backup.xml
Remove-aeObject -ae $ae -name JOB.WINDOWS
Remove-aeObject -ae $ae -path /DEMO/WFC_DEMO_OBJEKT 

# ...und tschüss!
$ae.bye()

You can get a first impression of the eLearning on Youtube. This link will lead you to a live demonstration.

The eLearning is available in German and you can take a look at it here: WFC::Core – Powershell und die Automic Automation Engine

The English version is in the making but will take some more time. Like the German version, it will cost 1999€ and is compatible with Powershell v3+ and AE10+.

Are you interested? You can find more information at http://workflowcommander.ch. And if you have questions, you’re welcome to contact me via mail or Xing / LinkedIn. If you just want to get a notification once the video is ready, you may subscribe to the newsletter of Philipp Elmer. He will inform you, once everything is set up.