Maximo

Maximo

Come for answers, stay for best practices. All we're missing is you.

 View Only

Making your Maximo objects available on the Map 

Mon March 16, 2020 01:52 PM

How to make any Maximo Object to be geo referenced in Maximo Scheduler

Author: Rafael Thomas Goz Coutinho, Advisory Software Engineer

Maximo Scheduler 7.5.1.0 introduced the new Map component. The Map component allows users to visually see Maximo entities with actual geographic locations. This empowers the user to have a geographic information system (GIS) in Maximo and to be able to easily establish geographical relations to improve the decision-making process.

The following entities are geo referenced by default in Maximo Scheduler: Service Address, Asset, Location, Workorder (and its extensions), Service Request (and its extensions), Labor and Crew. However it is possible to easily extend any Maximo object (MBO) to have GIS information and be used in the Map component.

This article describes how to extend any Maximo MBO to be used in the Maximo Scheduler Map component added in version 7.5.1.0.
 

Implementing GISable interface on MBOs

In order to allow the Map Component to manipulate a MBO, you it must implement the provided interface com.ibm.tivoli.maximo.map.interfaces.GISable. Add this interface to your MBORemote interface and implement the methods defined. The methods are used for loading the MBO coordinates and persisting them. The following methods are required:Double getLatitudeY() - return the latitude coordinate (or the Y coordinate if you are using a generic coordinate system) double value.

  • Double getLongitudeX() - return the longitude coordinate (or the X coordinate if you are using a generic coordinate system) double value.
  • String getAddressString() - return the address string for this location.
  • boolean isGISDataReadonly() - if this data cannot be updated using Maximo (for example this data is loaded thru an external system directly from a GPS) this method disallows to make udpates on the GIS data.
  • void saveGISData(String address, String lat, String lng) - this method must implement the logic to persist the GIS data. You must implement here where to save the latitude, longitude and address string data.
  • boolean hasCoords() - returns true if this MBO has any coordinate and can be displayed on the map, else returns false.

By implementing these methods on a MBO it will be available for manipulation on the Map. It can be displayed, its geographic location can be set directly from the Map by using the Map tools, and actions can be performed on them, directly on the Map by using the Map tips configurations.

The next section is an easy step-by-step example with code samples to show how to make the Maximo Item object a GIS Maximo Object and links to instructions for adding a Map tab to Item Master application and configuring Maptips to it.
 

Code Sample: Making the Item Maximo Object GISable

As described in the previous section, in order to make a Maximo Object available on the Maximo Scheduler Map component, you have to implement the GISable interface. Here is a code sample demonstrating some code to implement it on Maximo Item object.

First of all we need to add the object attributes that store the GIS information. In this case 3 new attributes are added to the Item object: Latitude, Longitude and Address. The database configuration application can be used to accomplish it, or you can use the following DBC script to add the new attributes:

<add_attributes object="ITEM">
<attrdef attribute="LATITUDE" maxtype="DECIMAL" title="Latitude" remarks="The latitude of this object." length="18" scale="10" persistent="true" haslongdesc="false" required="false" mustbe="false" ispositive="false" canautonum="false" />
<attrdef attribute="LONGITUDE" maxtype="DECIMAL" title="Longitude" remarks="The longitude of this object" length="18" scale="10" persistent="true" haslongdesc="false" required="false" mustbe="false" ispositive="false" canautonum="false"/>
<attrdef attribute="ADDRESS" maxtype="ALN" title="Formatted Address" remarks="The address of this entitty." length="150" persistent="true" haslongdesc="false" required="false" mustbe="false" ispositive="false" canautonum="false" />
</add_attributes>

Once the attributes are added to the Maximo table (the script above was run and database was updated) it is time to add the GISable interface to the ItemRemote interface.

[...]

 import com.ibm.tivoli.maximo.map.interfaces.GISable;

/**
* Remote Interface to the Item object.
*/
public interface ItemRemote extends StatefulMboRemote, MboRemote, GISable
{
[...]

And then implement the methods of it in the Item class:

 [..]
       @Override
	public Double getLatitudeY() throws MXException, RemoteException
	{
		if (isNull("LATITUDEY"))
		{
			return null;
		}
		return getDouble("LATITUDEY");
	}

	@Override
	public Double getLongitudeX() throws MXException, RemoteException
	{
		if (isNull("LONGITUDEX"))
		{
			return null;
		}
		return getDouble("LONGITUDEX");
	}

	@Override
	public String getAddressString() throws MXException, RemoteException
	{
		return getString("FORMATTEDADDRESS");
	}

	@Override
	public boolean isGISDataReadonly() throws MXException, RemoteException
	{

		return false;
	}

	@Override
	public void saveGISData(String address, String lat, String lng) throws MXException, RemoteException
	{
		if (lat != null && lng != null)
		{
			this.setValue("LATITUDEY", Double.valueOf(lat));
			this.setValue("LONGITUDEX", Double.valueOf(lng));
		}
		if (address != null && address.length() > 0)
		{
			this.setValue("FORMATTEDADDRESS", address);
		}
	}

	@Override
	public Boolean hasCoords() throws MXException, RemoteException
	{
		if (getLatitudeY() != null && getLongitudeX() != null)
		{
			return true;
		}
		return false;

	}
[...]

And it is done. Now you just need to add the Map to Item Master application. This process is described in Adding a Map to any Maximo application.

Remember to set the Map control property Map is view only to false so the entities (Item) in Maximo can be manipulated.









#Maximo
#Scheduler
#MaximoScheduler
#AssetandFacilitiesManagement

Statistics
0 Favorited
18 Views
0 Files
0 Shares
0 Downloads