Search This Blog

Tuesday, August 29, 2023

MAXIMO : Email Listener using OAUTH using GMAIL account - 7.6.1.2 /3

 Here I am going to provide details steps for how to configure email listener using GMAIL with OAUTH authentication.


Pre-requisite you should have SMTP configurations set up and emails in Maximo are already working.

You may refer IBM documentation for this - Configuring SMTP.

So once SMTP is properly set up and email sending through Maximo applications works fine , we will need to move to prepare and get OAUTH parameters like Refresh Token , Client ID , Client Secret etc. for email address being used for email listener with OAUTH protocol.

Here I will cover steps for getting these details for Gmail account.

First step is to have email account  : Create a new Gmail account   / you may use your existing Gmail account.

Next steps is work with Google Cloud API to configure and generate/ get required parameters like Client ID , Client Secret and Refresh token for above Gmail account using cloud API library services.

Broadly this can be done using following steps :

1. Set up project using Google cloud dashboard logging in with your Gmail account.

2. Next enable GMAIL API under your project

    


3. Once API is enabled , credentials need to be created for connecting to account via GMAIL API

            

    




After hitting Save and continue , you should provide scope for API access /authorization
         


Now you should be able to download details in JSON format or can copy it from google cloud dashboard like Client ID , Client Secret.

    


Now next step is to get refresh token for this Email configuration/ client ID using postman client :
To get refresh token first we need to get code to establish session with api

URL :   Hit URL from browser in below format and within browser while redirecting it will generate CODE
        

It should ask you to login using your email account 
    

Then you have to click "continue" couple times and it will redirect to your maximo login page / redirect URI provided during credentials creation.
After successful login , you can try putting same above URL again and proceed is similar manner as session was already established this time it will automatically login maximo and URL
will now have auth code 





Postman POST request should be done to get refresh token :
URL :  https://oauth2.googleapis.com/token?
Parameters - client_id , client_secret ( values received in above steps)
redirect_uri : - your maximo url e.g. https://host:port/maximo ( which is used as redirect URL during credentials
creation )
grant_type : authorization_code
     prompt = consent
access_type = offline





This request should give you refresh time on first iteration.

Once you get refresh token you should be able to configure Email Listener within Maximo.





This will now complete Email Listener configuration using OAUTH.

I will continue and update this post for additional configurations like Email Interaction and sample PO workflow where PO status will be changed via email response being listened and processed by email listener.


Friday, August 4, 2023

MAXIMO : MIF Integration Changing status with inbound processing

 

How do we have change status functionality get triggered and record status history when sending inbound transaction with new status than the current one on record ?


Status change is an operation that is performed on stateful Maximo Business Objects. For example, a Person object can be changed from ACTIVE to INACTIVE and back by means of a button or menu selection in the application screen.

In order to perform a status change with an inbound Integration Framework transaction, you must include the STATUSIFACE and NP_STATUSMEMO attributes in addition to the STATUS attribute with the new value, and use the StatefulMicSetIn processing class. (Integrations that are provided with Maximo already use this class or have an integration-specific processing class which is an extension of StatefulMicSetIn.)

Note that the STATUS and STATUSDATE fields should be restricted in the object structure. Verify this in the Inbound Setting Restrictions in the Object Structures application.

STATUSIFACE is a boolean attribute which specifies how the transaction should be processed with regards to status changes:

STATUSIFACE=0 - This transaction will perform the specified Action (Add or Replace for example) on the data, save it, and then, if the new status is different from the existing status, perform a status change operation. Note that an invalid status change, such as attempting to cancel a closed workorder, will cause an error.

STATUSIFACE=1 - This transaction is ONLY a status change. Any data other than the key attributes which identify the record are ignored. If the new status is different than the existing status, perform a status change operation.

STATUSIFACE not present or has a null value : not present or null value are treated as STATUSIFACE=0.

The NP_STATUSMEMO attribute is used for the memo or remark which accompanies the status change. For example, if changing a workorder status, the value of NP_STATUSMEMO will be placed in the MEMO field of the WOSTATUS record that is inserted by the status change.

If you create a custom Object Structure for a stateful Maximo object, you must also add STATUSIFACE (and NP_STATUSMEMO if the status has a remarks or memo component in the status change dialog on the screen) to the Object Structure by adding it as a nonpersistent attribute to the main object in Database configuration. 

You must also specify psdi.iface.mic.StatefulMicSetIn as the processing class in the object structure definition. If you are creating a custom processing class, then it must extend the StatefulMicSetIn class.

Usage

In most cases you will only need to specify a STATUSIFACE of 0. This will ensure that the integration action is carried out and that the status will be changed if the new status is different.

If you plan on sending in transactions that will only change a status, such as approving a workorder or deactivating a person, then you can use the same integration that you use for data updates with status changes, but set STATUSIFACE to 1 and only send the key attribute values which identify the record, such as WONUM and SITEID for a workorder, along with the new status value.

Reference : IBM Technote MIF Changing status with an inbound transaction