Wednesday, 3 January 2018

Introduction to Application Engine for Infor BI

I was doing some research on Predictive Analytics recently and there are so many tools in the market which offers this functionality.

Then I thought about Infor BI. Well Infor doesn't have an analytics component inbuilt. At least that what i thought. And then I got to know about Application Engine Process Editor.

So what is Application Engine ??

This is Infor's definition

The Application Engine Process Editor is a tool that you need to define, verify, compile, test, and publish Application Engine processes. In principle, Application Engine processes are plain text files that contain the code written in the BI# programming language. The Application Engine Process Editor includes a text editor and supports the whole life cycle of a process.


Basically you can create custom programs using B# which is very similar to C# and these programs or processes can be called from Application Studio web services.

Let's see how we can do this later in the post.

Let's open up Application Engine and click on the log on button.

Connect to the repository where you will want to store the processes.



Let's go and create a new process...



When you click on the new option it opens up a new process editor shown above.

Copy the below code and paste it to the editor.

#define EngineVersion 4.0
#define RuntimeVersion 4.0

int HelloWorld(int a,int b)
@Description"App Engine Addition";
@Category"Place your process category here";
@Returns"Returns an Integer";
@Parameter[a]: "Input Para 1";
@Parameter[b]: "Input Para 2";
{
    /* To use intellisense press Ctrl-Space and select a function from the list */
    /* To use autocompletion start typing the function. When the right function appears type the round opening bracket and select from a list of available signatures. */
    /* add your BI# code here */

    int number = a + b;
    WriteLocalFile("C:\\Files\\RnD\\Blog\\App Engine\\Test.txt""a+b is : " + number);

    return number;
}

The first 2 lines defines the version of the Engine and the Run time. Use the default 2 lines which you get when you create a new process. The version I am using here might be different to what you have in your environment.

Next you have this line int HelloWorld(int a,int b)

This is the HelloWorld method which takes in 2 integer variables named a,b and outputs an integer variable.

@Description"You need to describe the process here";
@Category"Place your process category here";
@Returns"Define the return type here";
@Parameter[a]: "Input Para 1";
@Parameter[b]: "Input Para 2";

If your method is using input parameters then it is mandatory that you define it using the @Parameter[] function used above. Depending on the number of input variables you have , you need to define @Parameter tags for each of the variables.

Next i add the 2 variables and assign it to a variable named number and I also write the value to a text file in my environment.

    int number = a + b;
    WriteLocalFile("C:\\Files\\Rnd\\Blog\\App Engine\\Test.txt""a+b is : " + number);

    return number;

Finally I return the number variable to the program which called the process.

Now let's test our process............

Before you test it save the definition file so that you do not lose this code :).

Click on the Validate button to make sure the syntax is correct and once confirmed click on the Test Process button.

Enter values for a and b as shown below.....


Click on the run button ( Green button)



There you go, the process add up the 2 numbers and gives an result of 60. And it has also written the value to the Text file.

Let's publish this to the repository so that App studio can call this process.



Once published you can have a look at the processes by clicking on the load button.



Here I have 2 version of my HelloWorld Process. And depending on the details you have specified it will show up here.

In my next post I will explain how to call this process using Application Studio. Stay tuned geeks...


1 comment:

Blog Archive