Use Case - IBM

flashypumpkincenterΛογισμικό & κατασκευή λογ/κού

14 Δεκ 2013 (πριν από 3 χρόνια και 6 μήνες)

214 εμφανίσεις

Maximo/SCCD Extensions and Integration

12/14/2013




Page
1

Overview


This document is intended to take the reader through
a use case

of how you can leverage
the tooling provided with the Maximo products in order to add value through product
extensions and/or integration to other products.

All Maximo features desc
ribed below are
also available as

part

of the SCCD solution.



Use Case
: Extend the Asset object with 3 new attributes, make those
attributes available in the UI and enable those attributes to be
updated from another application using integration.


This u
se case will hi
-
light the following
capabilities:


1.

Adding new attributes to
the

Maximo
Asset
object

2.

E
nabling new attributes within the asset

application for viewing by a user

3.

Enabling new attributes to be part of a SOAP
-
based web service

for update by an
e
xternal system.



Adding new attribute
s to the Maximo Asset Object


At the start of this type of integration, the first step is to identify what object is the
appropriate one to extend. Often this is decided based on the application you want the
addition
al attributes to be available from. There are a multiple ways to determine which
object(s) is connected to
an application, below are two:


Maximo/SCCD Extensions and Integration

12/14/2013




Page
2

a.
Identify the Main object of the application using Application Designer app. Note:
columns from other objects are

likely to be used with the application.
























b.

Using field help by placing cursor into a field and
hitting

Alt/I






Maximo/SCCD Extensions and Integration

12/14/2013




Page
3

Once you have identified the object that you wish to extend
,

you then can use the
Database Configuration applicatio
n to add your a
tt
ributes to the business object and its
underlying table in the database.




When you define a new field you can set properties such as data type, length, title (label
that is displayed in UI) and default va
lue. Depending upon your requirements

(if field is
not read
-
only)
, you may want to define an associated domain to control the values
allowed

or provide a Java class and/or script that contains validation logic for the field.


After you have defined the ne
w fields
,

these changes must be applied
to the database
by
setting the system into Admin Mode and then running DB Configure. When completed
,

you need to exit Admin Mode and your fields should be available in the ASSET Maximo
Business Object (MBO) and defi
ned in the underlying ASSET table in the database. At
this point you can now configure the Asset application to display the new fields that you
added to the ASSET object.


If you plan to develop new business objects, there is additional information at thi
s link:
https://www.ibm.com/developerworks/community/wikis/home?lang=en#!/wiki/IBM%20
Maximo%20Asset%20Management/page/Maximo%20business%20object%20developm
ent
.






Database
Configuratio
n Application

Define
attribute

Maximo/SCCD Extensions and Integration

12/14/2013




Page
4

Enabling the Asset application to
display
new attribute
s


The Application Designer applicat
ion allows you to configure the UI for existing (or
new) applications. You can add new fields to the UI, move the location of existing fields
or remove UI fields from the application.


For more detailed information on customizing the Maximo UI, see the f
ollowing:
https://www.ibm.com/developerworks/community/wikis/home?lang=en#!/wiki/IBM%20
Maximo%20Asset%20Management/page/Configuring%20the%20user%20interface



For our use case, we will add the 3 new attributes
created earlier to the Asset

tab of the
Asset
application.



































Maximo/SCCD Extensions and Integration

12/14/2013




Page
5

To add a field, select the section you want to add field to. One way to add a field is to
select an existing field in that section and right click and select Copy. Then if you right
click and select Paste a

new field will be placed directly below the selected field:













sdf

Maximo/SCCD Extensions and Integration

12/14/2013




Page
6

Once the new field is on the canvas (above), you right click on the field and select
Properties. Perform a look up on the Attribute field and select your new field by entering
the field name and object name in the Select Values dialog (below).




After the attribute is selected you can then provide additional information such as a
customer fiel
d Label and

Input Mode
.




Maximo/SCCD Extensions and Integration

12/14/2013




Page
7

You can then repeat this process for all the fields you
plan to add.
























Maximo/SCCD Extensions and Integration

12/14/2013




Page
8

Enabling new attributes for integration

Now that the 3 new attributes are part of the Asset object and visible in the Asset
application, you are now in position to provide data for those attributes using integration.

To support updating a fields using integration, the fields must be configured as included
within an existing object structure. Since our new fields are persistent (saved to the DB),
these field
s

would automatically become part of any object structure that

has the ASSET
object wthin it. For our use case will we assume that we plan to use the MXASSET
object structure.























Now that we know the object structure supports the new fields we added, the next step is
to decide how to integrate da
ta into those fields. There are multiple options that an
integration can leverage, often times this is decided based on the capabilities of the
external system that is integrating with Maximo.


From a protocol perspective, let’s assume that the external

application, by practice,
prefers to integrate with other applications using SOAP
-
based messages (web service).
Given that, this eliminates other possible options that the integration framework support
s

such as XML/HTTP, REST, DB tables, delimited files
and XML files.


With the protocol set to SOAP, there are still 2 possible options, enable the object
structure as a web service or configure an enterprise service on top of the object structure
and enable that as a web service. Using the enterprise servi
ce provides the capabilities to
push the message through a JMS queue (asynchronous processing) if desired and also
provides the ability to implement customizations using the processing rules feature, Java
or XSLT. In our case let

s say that the integratio
n should be synchronous and there is no
Maximo/SCCD Extensions and Integration

12/14/2013




Page
9

need for customiz
ation as the client will invoke

the
object structure
web service with the
correct XML format based on the
Maximo
schema.
Using the Web Service
s Library
application, an

object structure
web service w
ill be created using the MXASSET object
structure.






















Maximo/SCCD Extensions and Integration

12/14/2013




Page
10

The screen below shows the web service created for MXASSET with the available
operations.
























The final step is to deploy the web service which will generate sche
ma and WSDL files.
Depending upon the customer implementation of the system, the web service may be
deployed using the Axis SOAP engine (Product container) or using the application server
(Application Server container). See this link for more information
:

http://pic.dhe.ibm.com/infocenter/tivihelp/v49r1/topic/com.ibm.mbs.doc/wsregistry/c_ctr
_overview.html



Below is a screen shot of the s
tep to deploy the web service:


Maximo/SCCD Extensions and Integration

12/14/2013




Page
11























When deployed, the WSDL and Schema files will be located in subfolders under the
integration Global Directory (defined in system property mxe.int.globaldir). Depending
upon property configurations
,

th
e schema file may resolve

‘included’ files

to a single file
(recommended) based on the setting of the mxe.int.resolveschema to 1 (true). The
WSDL file can

include

the schema file if the mxe.int.wsdlincludesschema system
property is set to 1 (true).


The

object structure service schema is located at:

http://hostname:port/meaweb/schema/service/MXASSETService.xsd


The
WSDL

file for the service is located at:

http://hostname:port/meaweb/services/MXASSET.wsdl


The web service is available to invoke at:
http:
//hostname:port/meaweb/services/MXASSET


For all of the above, MXASS
E
T represents the object structure name.



Maximo/SCCD Extensions and Integration

12/14/2013




Page
12

Now that the web service is deployed the next step is to create a SOAP client on the
external system that can build the XML message according t
he Maximo schema and
invoke the Maximo web service.

You can retrieve the schema as mentioned above and
also view a sample XML from the object structure
application.


For the MXASSET object structure t
he XML could be something similar to below. This
XML u
ses the ‘Sync’ operation of the service which will attempt to find the asset record
and update it. When the Asset does not exist, the service will create the asset. The ‘key’
of the Maximo Asset that will be used to find the asset is the ASSETNUM and SIT
EID.
These values must be passed in order to find an existing record. In the example XML
below, the processing will attempt to find asset SAMPLE1 in site BEDFORD
.


<?xml version="1.0" encoding="UTF
-
8"?>

<SyncMXASSET xmlns="http://www.ibm.com/maximo"
xmln
s:xsi="http://www.w3.org/2001/XMLSchema
-
instance" creationDateTime="2013
-
05
-
01T11:10:29
-
05:00" transLanguage="EN" baseLanguage="EN">


<MXASSETSet>


<ASSET>


<ASSETNUM>SAMPLE1</ASSETNUM>


<CHANGEBY>MAXIMO</CHANGEBY>


<CHANGEDATE>2013
-
05
-
0
1T15:32:11
-
05:00</CHANGEDATE>


<DESCRIPTION>SAMPLE ASSET 1</DESCRIPTION>


<NEW1>Field 1 Value</NEW1>


<NEW2>Field 2 Value</NEW2>


<NEW3>Field 3 Value</NEW3>


<SITEID>BEDFORD</SITEID>


</ASSET>


</MXASSETSet>

</SyncMXASSET>


If
the record is found, processing will update these fields: DESCRIPTION, NEW1,
NEW2 and NEW3. Any attributes (or other objects/attributes of the object structure) that
are
not provided

in the XML are
not updated
. For records being created, many fields not
provided in the XML are likely to be populated with a default value as configured in the
business object.


If you were to use the Maximo SOAP
-
based web service belo
w are some sample code
snippets that show the building a web service URL


This code build
s the service URL and attaches the XML payload (describe earlier)



QName serviceQName = new QName("http://maximo/"+serviceName, serviceName);


QName portQName = new QName("http://maximo/"+serviceName, serviceName+"Port");


Service svc = Se
rvice.create(serviceQName);


if(soapVersion == null) soapVersion = SOAP11;


svc.addPort(


portQName,


soapVersion.equalsIgnoreCase(SOAP11)?SOAPBinding.SOAP11HTTP_BINDING:SOAPBinding.SOAP12HTT
P_BINDING,



epURL);



Dispatch<Source> dispatch = svc.createDispatch(


portQName,




Maximo/SCCD Extensions and Integration

12/14/2013




Page
13


Source.class,


Service.Mode.PAYLOAD);



if(soapVersion.equalsIgnoreCase(SOAP11) && action==null)


{


action =
"";//for SOAP11 the action has to be specified as per BP 1.1


}



if(action != null)


{


dispatch.getRequestContext().put(BindingProvider.SOAPACTION_USE_PROPERTY,
true);


dispatch.getRequestContext().put(BindingPr
ovider.SOAPACTION_URI_PROPERTY,
action);


}


if(httpUser != null)


dispatch.getRequestContext().put(BindingProvider.USERNAME_PROPERTY,httpUser);


if(httpPassword != null)


dispatch.getRequestContext().put(BindingP
rovider.PASSWORD_PROPERTY,httpPassword);



This code invokes the
web
service



Source input = bytes2Source(payload);


// Invoke the operation.


if(mep == null || mep.equals(MEP_SENDRECEIVE) || mep.equals(MEP_SENDROBUST))


{




Source output = dispatch.invoke(input);



byte[] response = source2Bytes(output);



return response;


}


else if(mep.equals(MEP_FIREANDFORGET))


{



dispatch.invokeOneWay(input);


}


return null;


}