Search This Blog

Friday, November 3, 2017

Write an escalation in Maximo and migrate it

Plan for migration before creating the escalation.


Go to MM and create a change package and include BPM group , approve and activate.

Make sure its capturing the records by using Selection action and event tracking records.

Lets talk about escalations now, hope your mm package is active and listening to changes.

Escalation is an action or a group of actions on the escalation points which can be triggered on predefined conditions.

You use Escalation condition to filter records out of the table.

image

Write a name and object it applies to (WO) and a condition to do filter records.

status in (select value from synonymdomain where domainid = 'WOSTATUS' and maxvalue not  IN ('COMP','CLOSE') ) and pmnum is not null

This is first level of filtering.

Now we can have multiple escalation points,different conditions basically on those records filtered above.

If you have a field which of of type date and you want to make different alerts according to the time interval, elapsed time interval is of a lot of use.

image

Your date attribute X                                                                  -7                          days


So elapsed time interval negative means in future. So this will fire 7 days before the date attribute. lets say your date attribute X has value( 9 June) and system date of Maximo server is 2nd june, this condition is satisfied and it will evaluate the escalation point condition. You can also give escalation point condition as an add on filter at this level.

If elapsed time interval is positive its in past, so if it would have been +7 days, so it will fire if X is 2nd June and sys date is 9th june.


First thing you need to create is roles, which are attached to communication templates and those are attached to the Notifications sub tab of the escalations application.


image

Roles can be of multiple types:

Custom

Custom class where you extend the

CustomRoleAdapter and implement the CustomRoleInterface

Sample Code

////////////////////

package xx.common.role;

import java.rmi.RemoteException;

import psdi.common.role.CustomRoleAdapter;
import psdi.common.role.CustomRoleInterface;
import psdi.common.role.MaxRole;
import psdi.mbo.MboRemote;
import psdi.mbo.MboSetRemote;
import psdi.server.MXServer;
import psdi.util.MXApplicationException;
import psdi.util.MXException;

public class xx extends CustomRoleAdapter implements CustomRoleInterface

{


public MboRemote evaluateCustomRole(MaxRole roleMbo, MboRemote currentMbo)
               throws MXException, RemoteException
           {

// play with currentMbo – the object specified on the Role creation panel in application

}


}



A Set of Data related to the record

If you want to get value of any related object via a relationship you can use this role.

image

You can get the gui for fetching the relationship and the required field, just click the arrow.



Email Address

Direct Email address punch

Person

Person id value(e.g maxadmin)

Person Group

Persongroup value (e.g admin)

A set of data related to login user

Any data from the logged in user.


Ok once roles are ready, check if they are getting tracked in the MM package.

Now create the communication templates and punch in roles.

Please note you can use the variables from the main object like :wonum in our case

make sure to check

image


Subject can be

Work Order :wonum is not approved

I think relationships also work, try it out.


Now our communication templates ready, punch them in the notification tab of the escalation.

Please note different escalations will have different notifications and different actions.


If you want to check if the escalation running make sure the master condition is attained, if not use sql developer and update records to bring some records in that condition.


If you want to debug your custom role, make sure you put the breakpoint on the evaluateCustomRole method and check the repeat option in the escalation point to true. That way you will be able to hit the breakpoint multiple times and test your custom role class.

*If you dont know how to debug, try putting system out in role class and check systemout logs.


I think that is it for the escalations part, you can also check the cron history for your escalation in the history tab of your escalation crontab.

If you want to see who all received emails, you can go to workorder log tab and check the communication log tab ,it will mention which all communication was triggered out of the work order.

Wednesday, November 1, 2017

How to migrate your configuration changes in Maximo via Change package ?

 

To move your changes to another environment, you can create and activate a change package in Maximo.

Just select the right migration group, which will capture your changes and it will be tracked once active.

Approve and activate the package and start doing your changes in the Maximo system.

After the first change make sure whatever you are doing is being captured by going to the –>View event tracking option in the Migration manager.

If all is well, you are good to go, keep changing and once done, create the package and distribute it to the target. There is another concept of migration collection in 7.6 but this works more or less for me.

Enjoy !

Tuesday, October 10, 2017

How to view pictures from the motion detection on Raspberry pi using motion.conf

Your pictures will be saved in /tmp/motion by default.

Create an alias on apache2 virtual host section on the conf file.

just after /var/www directory directive.

////////////

Alias /images /tmp/motion
<Directory /tmp/motion>
Options Indexes FollowSymLinks MultiViews
    Order allow,deny
    Allow from all
  </Directory>

///////////////////////////

Make another file called list.html and put it in the var/www the default doc root for apache.

here is the code for that file.

////////////////////////////////////



<!DOCTYPE html>
<html>
<head>
<script>
var folder = "images/";

$.ajax({
    url : folder,
    success: function (data) {
        $(data).find("a").attr("href", function (i, val) {
            if( val.match(/\.(jpe?g|png|gif)$/) ) { 
                $("body").append( "<img src='"+ folder + val +"'> -->" );
            } 
        });
    }
});
</script>
</head>
<body>


</body>
</html>

////////////////////////////////////

Make sure your /tmp/motion has 755 chmod.

Now restart apache2 and you should see the recent motion detected jpgs on the html browser as shown below.

Also set a cron on the pi to rotate the pictures folder every day or week so that you dont fill up your sdcard.

To find out how to expose this cam running on motion via pi, checkout my earlier tutorial where i explained port forwarding and duckdns.

Monday, October 9, 2017

How to get a public ip for a home camera running on Raspberry pi using motion.conf

IF you have attached a USB webcam to your PI and thinking to view it over the internet here is the way to do it.

Go to duckdns.org and login and get a url and the token.

Go to you pi and create a duckdns.sh script as shown below.

echo url="https://www.duckdns.org/update?domains=nameofcam&token=token&ip=" | curl -k -o /root/test/duckdns/duck.log -K -


Now go to crontab and create a cron entry like this.

*/5 * * * * /root/test/duckdns/duck.sh >/dev/null 2>&1

crontab reload

Make sure script has execute permissions.

Now test the url you specified in duckdns , you should see your camera ip being updated every minute.
Make sure you do a port forward on your router to the wlan ip of the camera.



Friday, September 29, 2017

Import and Merge XLS/CSV data into Maximo Database on Oracle

If you want to update values of certain fields inside database, one option is to make individual update statements in xl formulas as explained in another post and another option if you have huge datasets is to use MERGE commands from Oracle.


Steps:

Create a temporary table in database which will hold our data from CSV/XL

In Oracle SQL developer, click on Table and click data tab-- click action and import.

Navigate to xls/csv make sure column names match and first header has column names.

Import and accept defaults.


Now you have the database with your xl/csv data in table.
Now we will merge it with our actual table.

with below statement.



MERGE into prodtable t using ( select * from temptable) s on (t.location=s.location) 
when matched then
UPDATE SET t.fieldtoupdate = s.fieldtoupdate;


Your user should have insert update create rights on the schema where you are trying to do merge the data.

Keep Reading ! 


Thursday, September 28, 2017

Update Maximo Table Data using insert/update statements from the Excel Sheet into Oracle/SQL Server

If you want to update Maximo tables data with the new data from XLS sheet you can insert a new column in XLS

Lets say new column P

then in the formula bar use this formula if you want to generate  Update sql statements in the P column

= "update location set glaccount = '" & M1& "'  where location = '" & B1& "'"

Now if you want to generate multiple update statement in the complete P column just highlight and enter Ctrl+Enter

You will get a list of SQL statements, copy paste and run on Target Database.

Friday, September 22, 2017

Hide a field in Maximo

Go to Conditional Expression and create a new condition some thing like :fieldA <>''  (field value in mbo not null)

Go to Application designer and create a sig option for that field from select actioni -- add modify sig options.

Assign this sig option to our Field which we want to hide.

Go to Security Group and allow access for this sig option in that application and add above condition.

Sign out and re login , you should be able to see that field only when fieldA is not null.


Thursday, September 21, 2017

Create a listener on a field from another field class in Maximo

To create a field validation class we usually extend the mbovalueadapter which implements the mbovaluelistener.

If you want to create a listener on another field B from the field validation class of Field A here is the process.

Field A can have both domain and a field validation class and in our case we have a list from a table so we can extend the MaxtableDomain

In the init method of the field validation class of Field A create another instance of MboValueListener 

class FieldA extends MaxtableDomain{

public init(){
MboValueListener mvl = new OurCustomListener(getmbovalue(FieldB);
getMboValue.addListener(mvl);
}
}



In the above case as the page loads the init of Field A will create a listener in memory for field B and will listen to all 
the methods of a normal field validation class( Validat/action etc)

Implement the custom listener class 

class OurCustomListener extends mbovalueadapter {

constructor -- with mbovalue 

public action(MboValue mbv){
// this will be called whenever the FieldB changes 
}

}



So this way we can create listeners for multiple fields from one field class, this is use full for utility classes in Maximo where you don't want to change field validation at different places for FieldB but you have a generic FieldA and you can do all the changes there.


Tuesday, August 8, 2017

Android to Mysql via Php API using the Model/Fragment/Adapter architecture

Recently I was building an android app and there was a requirement to connect to MYSQL database from Android code, so I created a simple table in my mysql and wrote a few lines to PHP code to insert the data in my table. I had to invoke this php code from my Android fragment and show an alert dialog box.

I will explain you how to write this in the Fragment.

You should never do http based call  or networking calls on main activity and you are supposed to write an Async task for this.

Monday, June 12, 2017

IBM Watson knowledge studio for Cognitive modelling for different domains


We all know the NLU understands the basic language structure and can give you keywords and entities from a stream of string or text but what if you want custom entities and keywords from your domain. e.g Aviation or health care specific data and language analysis.


So a normal text can be fed to NLU OOB model and it will generate entities out of it but if you need to train your own model, you need to use IBM  knowledge studio and train the model.

watson knowledge studio train model

Lets get started.

Saturday, June 3, 2017

IBM Watson Cognitive app using Machine learning service Part 2

In the last article on “How to build a Watson cognitive app using node-JS”  we learnt how to get the SPSS model created and make it ready for the machine learning service.In this article we will learn, how to call that machine learning model and get prediction scores on Blue-mix.


This is right time to export the model stream which we generated in the last tutorial, you need to take that .str file and import it into the Machine learning service, To do that you need to bind the machine learning instance


Using Machine learning Model on Blue-mix

Login to the Blue-mix dashboard and create an IOT platform starter app, you can search for the boiler plate from the catalog page.

* In case you don’t have blue-mix access, you can always get a 30 day free trial.

Once your app is created, let it start for a while and click on the URL.

Once you click the URL you will be able to see the Node-Red flow page for that app.

Please note that when we use boiler plate, by default one node-red app is booted in the node JS run time,default memory is 512mb.

We will be connecting our node-red app also to the prediction service and we will also be creating a custom node JS app which will bind to the prediction service.

Friday, June 2, 2017

IBM Watson Cognitive app using Machine learning service

 

Cognitive App building with IBM Watson machine learning service.

Recently I have been hearing a lot of noise on cognitive and machine learning so I thought of giving it a try.

The hunt started with making a cognitive app which can learn from the old data and can use prediction service(Now IBM Machine learning) to give a prediction score for the current data.

 

Lets get started and build a Node JS app which can make real time prediction on IBM IOT watson platform and uses node red for real time predictions.

 

How to make an App and use the IBM Machine learning service

  • Getting the data
  • Installing IBM SPSS modeler tool
  • Finding and creating the right model
  • Stream the model out and use in machine learning.
  • Use machine learning in your red-node and node JS app
  • Show to contents on screen or save in cloudant DB

Friday, May 19, 2017

How to build ionic mobile app? Part 3 Services, Factory and Promises

 

In our last section on how to build ionic mobile app part 2 , we saw how we could send data from a page to controller and how we could access the scope variables and how we could set them from the controller.

 

In this section we will cover three main aspects:

  • Services in ionic
  • Factory
  • Promises
  •  

    Now we will design the second tab of our screen where we will have the asset details, lets say we have a truck and we want to fetch the details of this asset from the remote system.

     

     

    image

    How to build mobile app using ionic ? Part 2 The Architecture

     

    Last tutorial on How to build an ionic app part 1, we learnt how to quick start and get the components installed.In this part we will learn the architecture and map it with the code.

    Please note we are talking about ionic base version here which is V1.

     

    Lets map the architecture with the code base.

    image

     

    Thursday, May 18, 2017

    Debug ionic app with visual code

    If you are using visual code and don’t know how to debug the mobile app code, you are missing on a versatile feature of visual code.

    Some of the developers use visual code to only debug the mobile code, but a very few actually know how to attach the debugger to the live code and debug, it will also do a live reload of the application and will simulate in the browser also, in case you don’t want to debug in the real device or the android emulator.

     

    Lets download the debugger for visual code, available for cordova.

    image

    https://marketplace.visualstudio.com/items?itemName=vsmobile.cordova-tools

    Wednesday, May 17, 2017

    Ionic app development on virtual machine with Android SDK


    If you have planned to use virtual machine for mobile development and you have used VMware or virtual box to emulate the android device from ionic, this post is for you.

    If your app is ready and working via the ionic serve, its right time to bundle and see if it can be deployed to the android device. There can be other reasons like you may want to test the Bar code or the GPS of your phone inside your app. In both the cases you will need to build the app for android via ionic and render it inside the android emulator.

    In this section we will see how to quickly setup the android device emulator.
    First you need to download the android sdk and run the installation.
    https://developer.android.com/studio/index.html
    Download and run the setup with Admin access.
    If PATH and ANDROID_HOME are not updated after the install is complete, do that manually.
    PATH – /sdk/tools
    ANDROID_HOME – /sdk

    Open new windows command prompts and test the path command by typing android, it should work.

    Now its time to build our ionic app
    > ionic build android

    You might face an error on the build, about some license crap.
    Follow the solution below.

    ======================================================
    Can't accept license agreement Android SDK Platform 24
    ======================================================
    Follow this
    http://stackoverflow.com/questions/40383323/cant-accept-license-agreement-android-sdk-platform-24

    If the build is successful proceed, else keep debugging it.


    It should build the app, lets test if ionic is connected to the emulator.
    > ionic emulate android

    If android emulator doesn’t turn up, it could be a problem with your AVD(android virtual device) or the hardware virtualization is not enabled for your VM, I mentioned enabling the Intel Vtx setting of the processor on the vmware settings in the tutorial (How to build a hybrid mobile app using ionic ?)
    vm processor android adb virtualization

    Deploy ionic app on a real android device via USB on a virtual Machine

    In case you are ready with your ionic app and you want to push your app to the virtual machine either vm ware or the virtual box, this article is for you keep reading.

     

    This article will help in following situations:

    • You are not able to run the ionic app on your android device as a target and the live reload of your android app is not working.
    • If  your virtual machine is not able to load or list the devices and its not found on the system.

     

    ionic on android real device error

    I am assuming you are done with your ionic app creation and you have your real android phone and your virtual machine, vm ware in our case is ready.

    How to build a hybrid mobile app using ionic ? Part 1 Quickstart

     

    This will be  quick start where we will be setting up the components and understanding how ionic framework works and how to get started.I am using a Windows 8x 64 bit VM for this experiment and I have assigned 4 GB RAM and 60 Gb hard disk to it, I have also enabled the Intel Vt-x support for the two processors I allocated to this VM, we will discuss the advantage of assign the VT-x based processor to my VM later.

    image

    Wednesday, May 10, 2017

    how to add a load balancer on google cloud platform ?

     

    To add a load balancer as a front face to your application, you need to create an instance group first.

    An instance group is a group of your instances which will be a front end for the load balancer backend service.

    image

    Maximo as a service on Google Cloud Platform part 2

     

    In the last tutorial on how to install Maximo on Google Cloud Platform part 1

    In this tutorial we will learn how to add horizontal clustering to make our architecture scalable in both the dimensions.

    Lets create a new compute engine node (Windows 2008 R2) and move web sphere installation there.

    I used File zilla to transfer my existing installation to the node

    (Please make sure you zip the WebSphere folder and then transfer, else exploded folder might give errors when you try to run the PMT tool, I wasted 3 hours on it- Errors were around eclipse framework not found and not resolved errors from users/appdata folder)

    Open pmt.bat from( AppServer/bin/ProfileManagement/pmt.bat) and create a CUSTOM profile

    Monday, May 8, 2017

    Create cloud formation template from existing resources

     

    If you have defined your infrastructure and you want to create a ready to deploy template in the amazon cloud, you will have to create a cloud information template.

     

    Steps to create Cloud formation Template

    Navigate to the cloud formation template page.

    image

     

    https://ap-south-1.console.aws.amazon.com/cloudformation/home?region=ap-south-1#/stacks?filter=active

    Wednesday, May 3, 2017

    External IP not reachable on Google Cloud Virtual Machine

     

    If you have provisioned a new virtual machine on google cloud and you are not able to reach the VM or HTTP or any other protocol, you have come to the right place.

    Yesterday I created a windows machine in Google Cloud and I could not reach it over HTTP.

     

    Symptoms of this problem:

    • You will be able to ping the machine from internet but http fails.
    • You will be able to telnet on the 80 port but, network will time out.
    • Your windows machine is listening on port 80 but still the external ip is not routing to the machine.

     

    Please note that you don’t need to have a load balancer to access any machine in google cloud, it should have an ip address either static or dynamic, and it should work.

    Please follow the following steps to troubleshoot,will save half of your day.

    Step 1

    Make a firewall rule with highest rank and allow all tcp:80 for all the instances.

    image

     

    Step 2

    Navigate to the windows machine and turn off the firewall for a while.

    image

     

    You can enable it later, but for this test we need to disable it.

     

    Step 3

    Make sure telnet to port 80 succeeds from your laptop and the apache server on the target server is listening on port 80

    > netstat –an |findstr 80

    image

    It should show LISTENING status on port 80, also check the httpd.conf( it shouldn’t be bound to a specific address.

    image

     

     

    Now you should be able to connect to the machine over it external IP. if there are any issues you can comment and I will try to provide more inputs.

    Also if you are able to connect, please enable the firewall and allow only selective ports, 80 in my case.

    Also to note that the example specified above is for HTTP but you might face this while doing ssh/vnc/ftp or any other protocol.

    Keep Reading !

    Action Item: Subscribe & Share !

    Tuesday, April 25, 2017

    Google Cloud Platform Tutorial Series 103


    In our previous section we learnt how to operate google cloud platform using a quick start boiler plate for python, in this section we will learn about the containers.
    Containers are the heart of google cloud platform, our applications are deployed on containers(Dockers or google containers), these containers are a miniature version of virtual machines.Containers is a bundle of all the required components which are required to run a specific application.There is a one to many relations ship between a virtual machine and containers.
    To operate and orchestrate multiple containers google provides; Kubernetes.
    image
    Kubernetes is used for automating deployment, scaling, and management of containerized applications.

    Lets understand a few terms:

  • Cluster : Set of master/ worker nodes.
  • Node: Compute engine instance like a VM
  • Pod: A group of containers mostly Dockers
  • Replication Controller: Replica manager for pods
  • Controller Registry: Registry to host Dockers images

  • Google Cloud Platform Tutorial Series 102

     

    In our last chapter of google cloud computing platform quick start we learned how to quickly setup the google platform and get started with our first instance inside the cloud.

     

    There are multiple ways to interact with google platform:

  • Console Access (Easy GUI)
  • REST API(Programming)
  • Google Cloud SDK (Command line)
  • Client Libraries( Google API client library (Java-Python-Node JS etc.) –Discuss later
  •  

    Lets work on the compute engine via the shell and try to create a new instance using shell.

    Console Access

     

    image

    Sunday, April 23, 2017

    Maximo SAAS on AWS Chapter 106

    In our last tutorial on how to move Maximo to AWS , we saw how all the components were installed on different nodes and how horizontal and vertical clustering will work on WebSphere, In this part of the tutorial we will be doing final testing of our architecture and will start Maximo on both the nodes federated and running in a single Cluster
    Topics
    • Final Configuration
    Final Configuration
    Lets identify the default http port of our MaximoServer3(Custom node) and add it to virtual host.
    Now lets generate the Web Server (HTTP) plugin again and propagate it, so that our HTTP server knows about the new servers on different nodes and can do Round Robin.
    Ref:Generate propagate
    clip_image001
    Again I faced the unexpected- unsupported Class version error while starting my third (maximoserver3) on custom profile and reason is that it might be using the older version. So again we need to do managesdk to enable newer version of JDK for this WAS profile
    java.lang.RuntimeException: java.lang.UnsupportedClassVersionError: JVMCFRE003 bad major version; class=psdi/iface/gateway/

    Friday, April 21, 2017

    Find speed of local application using java



    If you have a local application and you would like to know how much time its taking to load, you can try this simple code snipped to find the load time and get insights on how much time its taking to load.

    Code:
    ==================================================================
    import java.net.*;
    import java.io.*;
    public class TimerTest
    {
        public static final Double NANO_TO_MILLIS = 1000000.0;
        public static void main(String[] args) throws MalformedURLException, IOException
        {
            int i =0;
            while(i<5){
            // start timer
            long nanoStart = System.nanoTime();
            long milliStart = System.currentTimeMillis();
            // do work to be timed
            doWork();
            // stop timer
            long nanoEnd = System.nanoTime();
            long milliEnd = System.currentTimeMillis();
            // report response times
            long nanoTime = nanoEnd - nanoStart;
            long milliTime = milliEnd - milliStart;
            reportResponseTimes(nanoTime, milliTime);
            i++;
            }
        }
        private static void reportResponseTimes(long nanoTime, long milliTime)
        {
            // convert nanoseconds to milliseconds and display both times with three digits of precision (microsecond)
            String nanoFormatted = String.format("%,.3f", nanoTime / NANO_TO_MILLIS);
            String milliFormatted = String.format("%,.3f", milliTime / 1.0 );
            //System.out.println("Milliseconds using nanoTime(): " + nanoFormatted);
            System.out.println("Milliseconds using currentTimeMillis: " + milliFormatted);
        }
        private static void doWork() throws MalformedURLException, IOException
        {
            URL url = new URL("http://google.com");
            URLConnection conn = url.openConnection();
            BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream()));
            System.out.println("Checking "+url.toString());
           
            while (in.readLine() != null) {
                //System.out.println(in.readLine());
            }
            in.close();
        }
    }

    ========================================================================

    Mount AWS S3 bucket on Windows

    If you need S3 bucket for storage of media and other documents, you might need to mount the S3 bucket on windows.

    Step 1: Create a bucket.


    First step is to create a bucket on AWS and save it(100 gig should be enough)

    Step 2 :Download TNT

    You will have to use

    https://tntdrive.com/

    Once you download this, it will install and will open a panel to input access key and secret.

    Get the secret and access key by creating an IAM user on AWS,


    mount s3 on aws windows tnt

    To create access key and secret key, navigate to:


    Create a new user and assign S3 bucket permissions from the select box and save.

    It will give you access key and secret access key, this needs to go to TNT  drive and it 
    will automatically search for our created bucket.

    Connect and it will map a local windows drive with your bucket.


    Now configure doc links for maximo to use this drive.

    Keep Reading ! 



    Google Cloud Platform Tutorial Series 101


    This series will be based on the Googles Cloud Computing Engine.

    image


    Quick start for Google Cloud.

    Lets Get Started.
    Topics



    Prerequisites
    Prerequisites for this tutorial series:
    • Basics of Cloud
    • A Gmail Account
    • A Debit/Credit card to start the free trial GCP.

    Wednesday, April 19, 2017

    Maximo SAAS on AWS Chapter 105

     

    In the earlier section of the series “Maximo on AWS” , we saw how we could start our Maximo instance on our EC 2 with RDS and vertical clustering enabled with node agent and the HTTP Server running.

    A quick diagram for reference:

    image

     

    Currently our architecture has a single point of failure.

     

    So lets federate another horizontal node to our Web Sphere ND and make it highly available.

     

    Recipe

    • Get a new EC 2 instance
    • Install WAS ND with app server profile
    • Federate and add members to cluster.
    • Generate and propagate web server plugin on node 1 for webserver1
    • Restart every thing and test high availability.

     

    Maximo SAAS on AWS–Chapter 104


    In our last part of the series on Maximo installation on AWS we saw how Maximo was installed on EC2 instance hosting its on SQL server and WAS ND with vertical clustering only.
    In This tutorial we will be adding a horizontal clustering using another EC2 to WASND and we will be utilizing the Amazons RDS database service to move our database also to scaling mode.

    image
    Lets get started.
    First of all lets get the RDS instance up and running.
    image


    Create a new RDS instance and make sure you select 2014 version only for SQL Server, 2016 is not compatible with Maximo and you might face an error if you try to use 2016. Error shown below.

    Upgrading IBM WebSphere 8.5.5 to 8.5.5.11 the easy way

     

    If you have WAS 8.5.5 and your application is not starting due to major minor version of class files errors on starting, you might be facing the JDK problem.

    image

    Websphere 8.5.5. is shipped with 1.6 JDK version( which is vague) but your application might have compiled code in recent version of Java.

     

    So in this case your option is to upgrade to 8.5.5.11 where 1.7.1 and JDK 8 are supported.

    Tuesday, April 18, 2017

    Maximo SAAS on AWS–Chapter 103


    In last tutorial on Maximo on AWS ,  we have moved our stuff to the EC2 instance and in this tutorial we will install the required Maximo software and other middleware components.

    This installation is divided into three parts:
    1. Maximo Base Install
    2. WebSphere and IHS install
    3. Plugin configuration and Horizontal node federation for scaling.

    * SQL Server is not mentioned above because it is already installed and Maximo user is configured and has all the rights.


    Monday, April 17, 2017

    Maximo SAAS on AWS- Chapter 102


    So in our last chapter, we saw how we created an EC2 instance on the amazon ec2 service.

    Agenda for this tutorial will be to get the instance ready and install IBM Maximo middleware components on it.
    Lets get started.

    Connect to EC2 Instance

    To connect to instance we will navigate to ec2 console and see if our instance is created.
    amazon ec2 instance running





    Click on connect.
    awsconnect

    Download the remote desktop file and use the username and password by clicking the get password.It will take you to key pair screen and you need to specify the mykey pair we used in earlier tutorial.

    image
    Now click on decrypt password and you will see RDP password to connect to this instance.
    Now you have all three:
    • Instance URL
    • Username
    • Password

    How to call REST services using conversation service API Part 2 of IBM Watson Chabot series ?


    REST API call from Watson conversation service


    In our last tutorial on IBM Watson chatbot using conversation services we learnt how to setup the chatbot with demo and do a quick start.
    In this tutorial we will see how can we instruct our chatbot to call our custom business logic, depending on the data entered by the user, this also explains how you can leverage this sample to build custom business logic around it.

    Lets take a use case of Maximo application, where user will be reporting a problem with the application and the chatbot will raise a service request for that incident by collecting data from the user.
    Please clone the following repo for this tutorial, customized for this use case.
    https://github.com/systemoutgit/maximobot


    How to make IBM Watson Chatbot using conversation service API Part 1 ?


    IBM has provided a lot of services with Watson platform. One of them is the conversation service which lets you make an intelligent bot for your customers which can be front end for your customers and can help generate leads and help with various other things like :

    • Quick reservations.
    • Service Tickets
    • Help desk operations.
    • Data Queries and analysis

    watson chat bot api
    Source : 1redDrop.com

    So today I will show you how to use that service and integrate that bot with your business. It could be any Java based platform or any other platform which has integration capabilities either by REST or Web Services.
    Lets get started.
    Prerequisites:
    • Node JS
    • Cloud foundry CLI

    Friday, April 14, 2017

    How to configure IBM Watson Conversation API ?

     

    Quick setup instructions for IBM Watson conversation API, mostly used with Bots and chat app.

     

    Copy the quick start sample from here.

    https://github.com/watson-developer-cloud/conversation-simple/archive/master.zip

    I changed my .env file and added username and password for the conversation service, you need to create the service from blue mix and use those credentials in this file.

     

    Also you will need a work space id for conversation service to work.

     

    Click on launch tool from the service and it will open the workspace manager, here you need to train your bot for various queries.

    Intents should be created and need to be linked with flows and entities.

    For our example we will import the car JSON data from

    training/car_workspace.json

    So it has some default queries answered and for this demonstration we will use this.

     

     

    image

     

    > npm install

    >npm start

     

    image

     

    image

     

    Now you can make your own workspace and train your bot for your queries, later you can plugin this into other apps.

     

    Keep Reading !

    How to use IBM Watson Text to Speech API via JAVA SDK


    I was trying to see how text can be converted to speech using WATSON API, but due to some or the other reasons I was getting a few errors while trying to test locally as well as on blue mix.


    I followed this link to set up the app.
    https://github.com/watson-developer-cloud/text-to-speech-java

    I could deploy but I was getting some error while testing the text to speech feature.
    For local it gave me error on
    ./target/wlp/bin/bluemixUtility import text-to-speech-service
    Some null pointer exception.

    For Blue mix
    Error while processing in red color on the results section of my page.


    Finally I had to understand the complete code and I got to know that credentials are not submitted properly to the service from the local system and cloud was not able to bind to the service and was giving “Unknown service exception)


    The following setup worked for me, try this.
    Step 1
    > mvn install

    and it created the target folder and it  has a liberty run time with it.
    image

    How to install and configure IBM Watson JAVA SDK

     

    I know Java SDK can be downloaded from the GIT but I had a few problems to configure it properly.

     

    Please follow the below steps to configure JAVA SDK for IBM Watson

    First download the SDK from the below URL

    https://github.com/watson-developer-cloud/java-sdk

    Use clone zip or GIT clone or what ever.

     

    Now go to java-sdk folder and run ( Assuming you have GRADLE installed)

    > gradle eclipse

    It will run for a while and will generate the required JARS and dependencies for your master JAVA SDK project.

     

     

    image

     

     

    After this, go to Eclipse and import the main java-sdk project.

     

     

    image

     

    Once completed, your workspace will be ready.

     

    Lets test one of the visual recognition API.

     

     

    Code

    ===================================

    package com.ibm.watson.developer_cloud.visual_recognition.v3;

    import java.io.File;

    import com.ibm.watson.developer_cloud.visual_recognition.v3.model.ClassifyImagesOptions;
    import com.ibm.watson.developer_cloud.visual_recognition.v3.model.VisualClassification;

    public class VisualRecognitionExample {
       
          private static final String VERSION_DATE_2016_05_20 = "2016-05-19";
        public static void main(String[] args) {
             
       

       
        VisualRecognition service = new VisualRecognition(VisualRecognition.VERSION_DATE_2016_05_20);
        service.setApiKey("your api key get from blue mix dashboard , create a VR service");


        System.out.println("Classify an image");
        ClassifyImagesOptions options = new ClassifyImagesOptions.Builder()
            .images(new File("src/test/resources/visual_recognition/car.png"))
            .build();
        VisualClassification result = service.classify(options).execute();
        System.out.println(result);
       
    }
    }

    ===========================================

     

    Result will be returned as

     

    {
      "images": [
        {
          "classifiers": [
            {
              "classes": [
                {
                  "class": "stock car (racing)",
                  "score": 0.959,
                  "type_hierarchy": "/vehicle/stock car (racing)"
                },
                {
                  "class": "car",
                  "score": 0.996
                },
                {
                  "class": "vehicle",
                  "score": 0.996
                },
                {
                  "class": "race car",
                  "score": 0.747,
                  "type_hierarchy": "/vehicle/race car"
                },
                {
                  "class": "gray color",
                  "score": 0.937
                }
              ],
              "classifier_id": "default",
              "name": "default"
            }
          ],
          "image": "car.png"
        }
      ],
      "images_processed": 1
    }

    My image looks like this

    image

     

     

    Point to note is while importing the java sdk, make sure you import the project and not choose the “open project from file system option in eclipse “

    Also you need to exclude parent folder from the build if you do a build all, it might error on build(Remove all sources and do Ctrl+B to build all projects)

    image

     

     

    Now you can explore other services from workspace itself, keep getting credentials apikey from blue mix dashboard and test all the services.

     

     

    Keep Reading !

    How to use Watson Speech to text API ?

     

    Speech to text is offered by Watson on blue mix, today we will see how to quickly setup the environment to use this service.

     

    Prerequisites:

    • Eclipse
    • Blue mix account

     

    Create a new Java  eclipse project and attach this jar in the build path.

    Now create a class file as shown below

     

    code

    ========================

    package com.ibm.watson.developer_cloud.discovery.v1;

    import java.io.File;

    import com.ibm.watson.developer_cloud.speech_to_text.v1.SpeechToText;
    import com.ibm.watson.developer_cloud.speech_to_text.v1.model.SpeechResults;


    /**
    * Recognize a sample wav file and print the transcript into the console output. Make sure you are using UTF-8 to print
    * messages; otherwise, you will see question marks.
    */
    public class SpeechToTextExample {

      public static void main(String[] args) {
        SpeechToText service = new SpeechToText();
        service.setUsernameAndPassword("username", "password");

        File audio = new File("src/sample1.wav");
        SpeechResults transcript = service.recognize(audio).execute();

        System.out.println(transcript);
      }
    }

     

     

    =======================================================================

     

    Username and password you can get from blue mix account , by creating a new instance of the service –> add credential

     

     

    Now put a sample wav file in the source folder of your eclipse project and run it.

     

    image

     

     

    Copy paste the wav and source for this speech to text demo from this github url.

     

     

    image

     

    The JAR attached has the java-sdk for watson and can be used to call any of the services hosted on blue mix.

     

    Keep Reading !

     

    Action Item : Subscribe & Share !

    How to use Watson Discovery service ?


    In this tutorial I will show you how to use Watson Discovery service locally and how to push an app to Blue mix using the cloud foundry command line tools( Node JS version)


    image

    Prerequisites:
    • Node JS
    • Visual Code
    • Blue mix account (Setup free account for 30 days)
    • Cloud foundry CLI

    Step 1 Clone Repo or download as zip from Github
    https://github.com/watson-developer-cloud/discovery-nodejs.git

    Step 2 Go to that folder rename .env.example to .env ( It should have place holders for username and password etc)
    This file need to be updated with the discovery service username and password, it also needs a discovery environment and the collection id( Watson news collection in our case)

    Tuesday, April 11, 2017

    How To Move Maximo Database on SQL Server to AWS using Azure Tool

    This article explains how to move Maximo database from SQL Server 2016 to AWS running on SQL Server 2008, using a simple tool provided by Azure platform.
    image

    Download the azure tool from the below path.
    https://sqlazuremw.codeplex.com/

    Open the tool SQLAzureMW.exe from the folder and run it.
    Make sure you have SQL Server installed on the server, else this tool won’t run.


    Monday, April 10, 2017

    Maximo Database Export Import from SQL server

     

     

    To export import the Maximo database from one instance to another instance, follow the following steps:

     

    Step 1 Open the SQL management studio.

     

     

    image

     

    Step 2 Connect to your instance.

     

    image

     

    Step 3 Navigate to your database

    image

     

    Step 4 Backup database

    image

     

    Step 5 Select the file system and click save.

    image

     

    Step 6

    image

     

     

    Step 7

    Now create a new database in target system.

     

    image

     

     

    Step 8 Restore the Maximo database now from the backup file we got from another instance.

    image

     

    Step 8 Add your backup location now.

     

    image

     

    Step 9

    Your new database is imported.