Technical Articles
How to create a Custom Task Template for BI Automation Framework
With BI 4.2 SP05 we have released the BI Automation Framework as part of the BI Administration Console. In this blog I would like to share more Information about the Custom Task Template Java SDK and how you can develop task templates and use them in the Automation Framework.
The Custom Task Template Java SDK allows you – via OSGI Plug-Ins – to add advanced functionality to the Automation Framework. For example you can develop Plug-ins using other APIs of the SAP BusinessObjects Business Intelligence Platform.
This tutorial walks you through the entire process of creating your first Custom Task Template Plug-in using sample content. Prior knowledge of Eclipse and Java is helpful, but not mandatory. We’ll walk you through the bits that you need to know.
More advanced concepts based on this tutorial:
Use JUnit to simplify the implementation of Custom Task Templates for BI Automation Framework
How to develop and debug a Custom Task Template for BI Automation Framework
We have also published samples you can explore and try:
BI Automation Framework Samples
Creating a Custom Task Template – Getting started
First, we’ll prepare the Development Environment. Then show how to modify & deploy the Task Template Definition, deploy the Plug-in and finally use the Custom Task Template in a Scenario.
To learn, how to develop and deploy an easy Custom Task Template sample, you can watch the Video or directly practice the steps as shown below.
Download – Getting Started Video (currently not available)
Prerequisites
- Java Development Kit 7 (or higher) (64-bit), installed
- BI Automation Framework Agent, Archive available
Installation Package in Folder: ..\Collaterals\Tools\Automation\biaca.zip - Task Template SDK Sample Projects, Archive available
Download – Sample Projects (SAP Note – 2626505)
Installing the Eclipse IDE
- Download Eclipse IDE for Java EE Developers (64 bit) from download.eclipse.org. This edition contains the tools needed to work with the SDK, for example, Plugin Development Tools. Caution Make sure that you only download this Eclipse version. Other versions, especially 32-bit versions, may not work correctly with the Component SDK.
- Extract the downloaded file to a folder.
- Locate and run the file eclipse.exe.
- Create a workspace, for example C:\TaskWriterUtility\workspace.
The workspace will contain all your SDK projects and the Eclipse IDE settings - Close the welcome page.
Importing the Task Template SDK Samples Project
- Use the Task Template SDK Sample Projects (see Prerequisites)
The ZIP file contains the sample Eclipse projects you can import to your workspace - In the Eclipse IDE select File > Import
- On the Import Dialog: select General > Existing Projects into Workspace
- On the Import Projects Dialog: choose the option Select archive file
- Browse to the location of the ZIP file > select open
- Select Finish
The sample projects will be listed in your workspace.
Setting the Target Platform
The target platform points to your Agent installation. This enables your Eclipse IDE to access the SDK included with the BI Automation Framework Agent.
You can use an already installed Agent or install the Agent:
- Go to Collateral\Tools\Automation on the BI platform installation package.
- Copy and unzip the biaca.zip file to the new Agent’s location. Let us assume that you have unzipped the folder at C:\TaskWriterUtility\Agent
After the installation of the Agent, follow these steps:
- Choose Start Window > Preferences
- In the Preferences dialog box, choose Plug-In Development > Target Platform
- Select the checkbox next to the list entry TaskWriter
- Choose Edit.
- Choose the Locations tab.
- Select C:\TaskWriterUtility\Agent\plugins If you have installed the agent to this location you can skip the next step
- Choose Edit to enter the location of the Agent plugin folder
- Select Finish
- Close the Preferences dialog box
- Project > Clean
- Choose Clean all projects
- Choose OK
This removes all error markers.
Import Launch Configuration to Run TaskWriterUtility command line tool
The first time you deploy a custom task template from your Eclipse IDE, you need to specify some configuration parameters and create a Launch Configuration to run the TaskWriterUtlity command line tool. We will use the configuration files and the launch configuration coming with the samples.
IMPORTANT:
The tools is checking the folder of the template location. Folder must start with ‘content/’ or must contain ‘/plugins/task_bundle/‘.
- create the folder C:\TaskWriterUtility\workspace\plugins\task_bundle
- Copy the sample from C:\TaskWriterUtility\workspace\com.sap.bong.task.sample\json\sampleTaskTemplate.json to this folder
- In the Package Explorer open the project TaskWriterUtility
- Open the file config.properties. You must specify settings of your BI platform and the location of the JSON definition
- Set values for RESTful_URL, username and password
RESTful_URL=http://<your server>:6405
username=<your username>
password=<your password> - The createTaskTemplateLocation1 is set to the folder of the JSON copied from samples
createTaskTemplatesTotal=1
createTaskTemplateLocation1=C:\\TaskWriterUtility\\workspace\\plugins\task_bundle\\sampleTaskTemplate.json
The command line tool will write information to the console, so it is important to display the Console view in your Eclipse IDE.
- Select Window > Show View > Console
Import the Run Configuration.
- In the Eclipse IDE select File > Import
- On the Import Dialog: select Run/Debug > Launch Configurations
- On the next Dialog: select Browse > C:/TaskWriterUtility/workspace/TaskWriter.sample
- Select TaskWriter.sample and TaskWriterUtilityCLI.launch
- Select Finish
The Run Configuration is created and available for future use to run the TaskWriterUtility command line tool within Eclipse.
Specify Custom Task Template Definition
To add a custom task template to the Framework, you must provide a JSON definition for your custom task template.
- In the Package Explorer open the project com.sap.bong.task.sample
- Open the file sampleTaskTemplate.json located in subfolder json The file contains the task template definitions like name, cuid, description and input & output parameters
- Important for now is the value for cuid: “generate” Use this value for new task templates to generate a CUID during the deployment. After the deployment you will replace “generate” with the CUID of the created task template InfoObject.
Deploy the Custom Task Template Definition
You can deploy the custom task template definition to the CMS database using the created Run Configuration as follows:
- Select Run > Run Configurations…
- Select Java Application > TaskWriterUtilityCLI
- Choose Run
IMPORTANT:
The Automation Framework service must be running (you can check in the CCM).
The TaskWriterUtility will deploy the definition to your BI platform and you will find some information in the console view, for example the Name, Id and CUID of the custom task template:
First Custom Task (7261, AeGuI0yrcTxLuyCuonSdfK0)
- Copy the CUID of the custom task template from the Console
- Replace the value in the file sampleTaskTemplate.json, of your project for example:
cuid: “generate” with cuid: “AeGuI0yrcTxLuyCuonSdfK0“ - Save the file.
In the Central Management Console (CMC) you should find the custom task template in:
BI Administration Console > Task Template > Custom
Export and Deploy the Custom Task Template Plug-in to the Agent
- In the Package Explorer open the project com.sap.bong.task.sample
- Open the file MANIFEST.MF located in subfolder META-INF. The file contains the plug-in Information.
- Make sure the Overview tab is displayed
- Select Export Wizard from the Exporting section
- Specify the Destination Directory, for example: C:\TaskWriterUtility
Deploy the custom task template plug-in to the Agent of your Server.
- Browse to the Agent Folder on your sever Installation, for example:
c:\Program Files (x86)\SAP BusinessObjects\AdminConsole\Agent\plugins\task_bundle - Copy the exported plug-in, for example com.sap.bong.task.sample_1.0.0.201711291009.jar from C:\TaskWriterUtility\plugins to the task_bundle folder
The already started Agent will register the plug-in and you’re ready to use the custom task template in the BI Automation Framework. If the plug-in is not registered, please restart the Agent in the Central Configuration Manager (CCM).
Use the Custom Task Template in a Scenario
- Logon to BI Administration Console
- Select Automation Framework > Workflow Templates
- Create a new Workflow Template
- Drag and Drop Custom > First Custom Task from the Task Templates list to the Canvas
- Save the Workflow Template for example with name First Custom Task
- Add a Scenario
- Drag and Drop Workflow Templates to the Canvas: Logon, First Custom Task, Logout
- Enter Parameter for Logon, select a Landscape
- Enter Parameter for First Custom Task, for example:
Sample Input Parameter = sampleInput
CSV Parameter (BI 4.2 SP6+) = select Object from Repository Explorer
CSV Parameter (BI 4.2 SP5) = id,name;100,myDoc;200,testDoc
The parameter values are just samples and will not be used during execution. - Enter Parameter for Logout, select the session
- Save and Run the Scenario
After the execution of the Scenario, Status should Show Success.
- Select View Results
- Check the Summary for the First Custom Task
- Select Show Details for the First Custom Task
Finally you can check, the Information is reflecting the implementation of the custom task template plug-in.
- In the Package Explorer open the project com.sap.bong.task.sample
- Open the file SampleTaskImpl.java
- Check the method, public String resultSummary()
contains the text displayed as Summary in View Results - Check the method, public String resultDetails()
contains the CSV text displayed as Summary in Show Details
Can you please provide links to the benefits to using the automation framework?
Thanks.
We are working on the final steps, plan is to have the links available by end of the week.
Hi Thomas,
Any updates on the links.
Thanks
The Download links in the blog are active for several weeks already (Download – Getting Started Video, Download – Sample Projects)
regards
Thomas
Hi, it seems the links are not working at the moment. I get "access expired" error ("Share is no longer available; contact the owner if you need access").
The sample project can now be downloaded from the mentioned SAP Note (unfortunately the video is currently not available)
Hi Thomas,
When we try to access SAP Note, we have
Sorry!
SAP Note/KBA 2626505 is being updated.
I still have the same message.
I think there is a problem with this note for people outside the SAP.
It was not 'Released for Customer', should work now. Thank you for your feedback and support.
It works now and I can download the SampleProjects file
Many Thanks
How can we find out more information on the tasks and workflows?
Specifically, I am looking for the strategy used by the Change Web Intelligence Source task and how to modify it.
see the answer in this blog: Automation Framework – Concept