Kapow Software was acquired by Kofax in 2013 and fits perfectly to Kofax’s First Mile™ strategy. Kofax Kapow provides a platform to process data from structured or unstructured databases, files, email systems, websites, portals and even legacy mainframe systems or terminal emulations. It handles automated extraction and transformation of data from Excel, XML, XLS, PDF, RSS feeds and from APIs based on SOAP, REST, XML and JSON.
A visual editor called Design Studio enables you to create automated workflows through a point-and-click design and to integrate the applications and data sources of your choice. This is achieved by the Kapow Synthetic API™ technology. The Robotic Synthetic API wraps existing applications or emulates APIs without coding. In Kofax Kapow such an automated workflow is called robot. Designed robots can be consumed as a REST Service or as an endpoint from .NET or Java.
Built robots can be uploaded from Design Studio to a centralised repository and are managed in the Management Console. The Management Console is moreover responsible for load balancing, failover and monitoring of RoboServer.
RoboServer is responsible for the execution of robots. The robots can be executed on-demand , via a Java or C# API, tailored REST Services or can be launched as a Kapplet.
Kapplets and KappZone
A Kapplet is a web application and exposes a user friendly interface to the robots. It can be customised for the end user’s demands. The Kapplet end users have their own KappZone with the Kapplets an administrator made accessible to them.
The Business Case
The codecentric website includes a subpage “Team” where many of us are listed and linked with our own subpages. These subpages disclose information about each employee as well as our specialised areas of expertise. When it is necessary to look for someone with a special skill set, you would ordinarily need to click all the subpages to have a closer look at the listed skills. I realise you would ordinarily just ask in the company’s Slack for this, but I want to direct you away from that. A robot will do this work, loop through all subpages, extract information, and in the event it finds a profile, sends an email:
Creating a Robot for our Business Case
Design Studio is the visual editor with which we want to create our robot. It offers several views to accomplish the creation of a robot.
The Project View gives you an overview of your robots and types or other resources.
The Robot View shows you the steps defined for a robot. You can switch between design and debug mode for later testing. Here you define your steps and actions of the workflow.
The Step View gives you information about a single selected step and shows all the configurable properties and mainly the action to process in this step.
If a step loads a webpage, the content is displayed in the Browser View.
The source of the related page is shown in the Source View.
The defined variables and their actual values of the robot are displayed in the Variables View.
Variables and Types
Before you define a robot you should think about the data the robot should extract. The extracted data has to be persisted in variables. There are already defined types like Short Text, Number, Binary, Image, JSON, Password and so on. These types are called simple types. But you can also create own types that have one or many attributes that base upon one of the existing simple types. These own types are called complex types. Input or output variables must always be of complex type.
Creating a new Project
In our Project View we create a new project named Blog.
After that we create two new folders named Robots and Types to separate between our robots and types. Now we have the following structure:
We want to create a type Blog first and it shall have the following attributes:
|Attribute Name||Attribute Type|
Finally we need a type for an input variable. When defining a type you can set a default value. That is useful for debugging a robot inside Design Studio.
|Attribute Name||Attribute Type||Default Value|
The types are defined by selecting the folder Types and then right clicking and choosing New » Type.
Creating a new Robot
Now it is time to create and develop our robot. We select the folder Robots in our project, right click and choose New » Robot.
We are now starting with an empty Robot View.
The triangle at the beginning marks the beginning of the robot and the crossed circle the end step of a branch.
Branches, Robot States and Execution Flow
The following example shows a robot that is executed linear, starting at the left most step and continuing sequentially to the end step where the robot stops.
For each step a robot has various elements that make up its state:
- currently open windows and frames
- cookies, authentication and other
The following example shows a non-linear robot with two branch points:
The robot executes each branch from top to bottom. Each time the robot reaches an end point, execution is continued on the next branch.
Each time a new branch is executed the robot reverts its state. If Step 1 in our example was a step were we loaded a page, then in Step 6 and Step 10 the state of Step 1 is preserved and the page doesn’t have to be loaded again. The robot just rolls back to where it left off.
If steps 5, 9 and 13 are doing the same action you can also join the steps.
And it is possible to build complex robots.
- The execution flow is as follows:
- Step 1 » Step 2 » Step 3 » Step 4 » Step 5 » End Step
- Step 6 » Step 7 » Step 8 » Step 5 » End Step
- Step 8 » Step 5 » End Step
- Step 9 » Step 10 » Step 11 » Step 5 » End Step
Once execution reaches an end step, execution will continue from the next branch of the most recently reached branch point.
For Each Loops
For Each Loops are exceptions to the rule previously stated.
These loops include the following actions:
- For Each Tag
- For Each Window
- For Each URL and other
If the end point is reached, the execution will not go to the next branch but to the next iteration of the loop step. If no more iteration remains, the execution will then continue from the next branch.
Once execution reaches an end step, execution will continue from the next branch of the most recently reached branch point or from the next iteration of the most recently reached loop step.
In the Variables View we have to define our variables for persisting data during our later steps.
|Variable Name||Attribute Type||Description|
|skill||Short Text||A temporary variable|
|blog||Blog||Variable for persisting our extracted data|
|skillSet||Long Text||A temporary variable for concatenation of skills (global)|
|input||Input||Our input skill the robot searches for|
Global variables persist their values during the execution of a robot.
After the concept of branches, states and execution flow, we are ready to define our steps to build our workflow. By right clicking on the beginning of our robot and selecting Insert Step After » Action Step we create a new step.
Every step needs an action to process. In the beginning the step is unnamed and undefined.
Load Page Step
The action of the step is defined in the Step View:
The exclamation marks show you that you have to choose the action for that step. We choose Load Page.
After inserting the URL we want to load, we just have finished our first step. If we click on the next step behind this step, in our case the end point, the Load Page step is executed. In the Browser View you can see Executing… while the page is loaded. After the page is loaded it is rendered in the Browser View.
For Each Tag Path Step
On this page all employees are linked with a photo that is also linked to the employee’s profile subpage. We want to loop through all of them. So after the Load Page step we insert a new action step and set the action to For Each Tag Path.
On the Finders Tab we define where to search, in our case:
And on the Action Tab we define the action that is performed inside the tag found by the defined path on the Finders Tab:
If we click on the step after this step we can test the iteration by clicking on the icons for next or previous iteration.
In the Browser View the image of the current iteration is marked by a blue frame.
Click Next Iteration
Extraction of Data
In the next step we want to extract data and assign it to our blog variable. We can use the Source View to achieve that. We select the tag we are interested in by clicking on it.
Then we right click and select the action Extract » Attribute, choose itemref and assign it to our variable blog.Team.
We do the same with a next step and extract the link to the profile page.
Loading the Profile Page
With the extracted data of the link the value is persisted in blog.Link. We create a new step and load the page with this link. We can also use a variable for the URL of this action:
If we click on a step behind this step the Load Page Action of the profile page is performed and the new page is loaded:
Extract More Data
We want to extract more data like image, name, title and email. We can do that by right clicking in the Source View and select what to extract and which variable to assign the data to.
The email is a tag attribute href and it’s value has a prefix mailto:. We can use a converter to get rid of this prefix and grab the email address.
On the Action Tab a converter can be defined:
In special circumstances we use a Replace Text converter:
At this point, our robot looks like this:
Loop Through the Skills
The skills are listed on the page and if we select the first list item in the Browser View we then can create a Loop For Each Tag and loop through all list items of this unordered list.
This is now our second loop we use and we extract the text of each skill in a following step. We assign the text to our temporary variable skill. After that we want to add the skill to our global variable skillSet and collect all skills from the profile page. This is done through another step and the action Assign Variable.
It is a simple concatenation of the single skills in our variable skill into our global variable skillSet.
This is what our second loop looks like:
At the end of the loop we have collected relevant data in our blog variable and all skills of one employee in the global variable skillSet. And consequently, we need to create a branch before the second loop.
Create a Branch
First we select the step preceding our second loop step, right-click and select Create Branch.
In this branch we need to check if the value of our input variable matches the collected skills in our global variable skillSet. If so, we send an email. Otherwise we skip the process flow and the execution flow goes to the next iteration of the first loop.
Checking, if the skills match the value of the input variable is achieved by a new step with the action Test Value:
If the condition is not satisfied then the following steps are skipped.
Sending an Email
At this point we have definitely found an employee that matches the skill we are looking for. Before sending an email we want to assign the value of skillSet to our variable blog.SkillSet and we want to be a bit puristic and get rid of a possible semicolon at the end:
Finally we need a step for sending of an email. On the Message Tab we have to define the addresses for the email, subject and the message itself. You can concatenate and combine text and variables. At last you can choose the Message Type – plain text or HTML.
On the Server Tab you have to define the credentials for sending the email.
On the Attachment Tab you can define attachments for the email. In our case we want to attach the image of the employee.
Our second loop and the branch look like this:
As our variable skillSet is global we need to reset it at the beginning of our second loop. We use a step with an Assign Value action and assign an empty string to the variable.
Grouping of Steps
It is possible to select steps and group them together. This is a convenient way to structure your robot. The steps can be hidden or collapsed:
Each step has an Error Handling Tab. Errors are logged by default and an API exception is thrown. In case an employee has no skills in his profile – and I faced that problem – an exception is thrown and the robot ends. Therefore you can decide not to throw an API exception and define to skip the following steps. In this described case the execution flow goes back to the next iteration of the first loop.
Final Robot View
And this is the final view of our robot with the grouped extraction steps.
And it works!
I must admit that this robot is just a robot to demonstrate how to work with Kofax Kapow. Normally you would have a robot that runs weekly and grabs the data of all employees and stores them in a database. Searching for employees with a special skill would go directly against the database.