IBM Support

Configuring Feature Classes to Save Maximo Records in Map Service's ArcGIS Table

Technical Blog Post


Abstract

Configuring Feature Classes to Save Maximo Records in Map Service's ArcGIS Table

Body

Configuring Map Services in Maximo is quite an easy task when using Spatial 7.6, allowing us to viasulize, create, edit and link map features. However, there are other types of

configuration that are a bit unusual and not that obvious. In this post, we'll see how to save Maximo records (assets, for this example) automatically into an ArcGIS table that's

published in a Map Service.

We'll use the example of recloser banks (a map feature) and recloser units (a table). Let's say you want to configure them as locations and assets, respectively. Your recloser

banks are able to contain multiple recloser units, making this a one-to-many relationship. For this situation, we have in our Map Service recloser banks as regular point

features and recloser units as lines in a table on the GIS side that will receive the assets created by Maximo. So whenever we create an asset which is associated with a location that is a recloser bank, Maximo will write the asset record in the GIS table when the Save button is clicked.

 

In case you have any doubt regarding the Map Service while following the steps in this document, check these screenshots of the Map Service being used to make the

configuration:

imageimageimageimageimage


To make this scenario work, we must start our configuration with the Map Manager application:

1. Create a new Map Manager record (or pick an existing one) and add a description to it.(don't forget to change the "Map provider name" to Maximo Spatial)

image

2. Add a site to your map record.

image

3. In the Map Services section, click "New Row" and add Map Service information (URL, Name and Order) along with a supported Basemap (in this example, we are using Esri's

Basemap: http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer).

image

4. Save your Map record.

image

5. Inside your Recloser line you just added in the Map Services section, scroll down to the Service Layers section and click Select Layers.

image

6. For this step we are configuring the Recloser Units table, so you can select any layer you want here (we'll be changing it in the next step) and click OK.

image

7. Expand the line you just added and change the ID and Name fields to the information that corresponds to your Recloser Unit.

image

8. Let's create a GIS object name for our Recloser Unit service layer and choose its parent MBO. For this example it'll be RECLOSERUNIT and ASSET, respectively.

image

9. Leave the system of record as Maximo and click "Execute GIS Configuration".

image

10. Leave all the fields checked and click OK.

image

11. Click "Create/Update GIS relationship Configuration" and configure the relationship as ASSETNUM = MXASSETNUM.

image

12. Configure your Recloser Banks layer normally (don't forget to configure it as a location!).

image

13. Click Save.

image

 

Now we will need to configure a JSON Mapping record for our recloser unit, but before that, a minor change must be done in our ARCGISASSET through the Object Structures

application.

Go to the Object Structures application and follow the steps:

1. Filter the list using the word "ARCGISASSET" and access the returned record.

image

2. In the Source Objects for ARCGISASSET section, click "New Row".

image

3. Populate the fields as shown in the image below.

image

4. Click Save.

image

 

By adding the LOCATIONS object as a source object, we'll be able get the facilityid attribute from the location record (in the JSON Mapping application) which is related to the

recloser unit asset. Now we can configure our JSON Mapping record, which will determine which attributes will be recorded in our GIS table.

Go to the JSON Mapping application and follow the steps:

1. Create a new record.

image

2. Change the Direction field to Outbound Processing and populate the Object Structure field with the value "ARCGISASSET".

image

3. Paste a query URL (in the URL field) which allows Maximo to extract the object structure from the response and tab out from it. In my case, since I don't have many lines in

my GIS table, I'm using a query which returns ALL lines from it (you can notice that by looking at the end of URL, which is "query?where=1%3D1&outFields=*&f=pjson"). However, a

query which returns only one line is enough.

image

4. Click Save.

image

5. Move over to the Properties tab.

image

6. In the JSON Object Mapping section, click "Map More Objects".

image

7. Click "//features"

image

8. Expand the line you just created and populate the Object Path field with the "ASSET" value.

image

9. Again, click "Map More Objects" and then click "//features/attributes".

image

10. Expand the line you just created and populate the Object Path field with the "ASSET" value.

image

11. Repeat steps 9, 10 and 11, but this time populate the Object Path field with the "ASSET/LOCATIONS" value.

image

12. Select the following line in the JSON Object Mapping section.

image

13. Scroll down to the JSON Properties Mapping for Process and map the the two values from the image below. (you can map as many attributes as you want, but in this example we

are only using these two)

image

14. Select the following line in the JSON Object Mapping section.

image

15. Scroll down to the JSON Properties Mapping for Process and map the value from the image below.

image

16. Click Save.

image

 


Now that we have mapped the attributes which will have their values written in the GIS table, we need to place this JSON mapper in the Map Manager record.

Go to the Map Manager application and follow the steps:

1. Open the Map Manager record which we configured previously.

image

2. Open the recloser map service in the Map Services section.

image

3. Open the recloser unit service layer in the Service Layers section.

image

4. Scroll down and populate the Response JSON Mapper Name and Outbound JSON Mapper Name fields with th name of the JSON mapper we created previously.

image

5. Click Save.

image

 


Now we need a way to identify wether the location being associated with the asset is a recloser bank. That way we'll be able to automatically fill the FEATURECLASS and

PLUSSISGIS attributes with the values "RECLOSERUNIT" and "1". Here's the flowchart of the process:

image
To complete this part of the configuration, we'll need to use automation scripts. In this example, we'll show the basic steps to complete the scenario illustrated in the

flowchart above, if you want to go deeper into automation to complete more complex tasks, we recommend you to check both our developerWorks Wiki and Maximo Automation Scripting

community on the links below:
https://www.ibm.com/developerworks/community/wikis/home?lang=en#!/wiki/IBM%20Maximo%20Asset%20Management/page/Customizing%20with%20automation%20scripts
https://www.ibm.com/developerworks/community/groups/service/html/communitystart?communityUuid=4ed1bb0d-a7d4-4484-b114-660fbd269690


Go to Automation Scripts application and follow the steps:

1. Under More Actions, click Create Script.

image

2. Populate the fields according with the image below.

image

3. In the Source Code text area, place the following code:

    from psdi.mbo import MboConstants;

    if mbo.getMboSet("ASSET_LOCATIONS").getMbo(0).getString("plussfeatureclass") == 'RECLOSERBANK':
        mbo.setValue("plussfeatureclass","RECLOSERUNIT",MboConstants.NOACTION | MboConstants.NOVALIDATION | MboConstants.NOACCESSCHECK);
        mbo.setValue("plussisgis",True,MboConstants.NOACTION | MboConstants.NOVALIDATION | MboConstants.NOACCESSCHECK);

4. Click Create.

image

5. Go back to the Application List.

image

6. Under More Actions, click Create Script with Attribute Launch Point.

image

7. Populate the Step 1 fields according with the image below.

image

8. Populate the Variables section in step 2 according to the image below.

image

9. Populate the Step 3 fields according with the image below.

image

10. Click Create.

 

Done! Now, after these long steps, you'll be able to save your recloser unit records in a GIS table.

[{"Business Unit":{"code":"BU005","label":"IoT"}, "Product":{"code":"SSLKT6","label":"Maximo Asset Management"},"Component":"","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"","Edition":""}]

UID

ibm11113075