Repository for publishing the integrated story of Maximo Manage + Watson.ai + Watson Assistant & Discovery
This example of github repo is to demonstrate of the ability to leverage certain AI and Generative AI functionality already built into the product as well as all the new use cases that are being continuosuly added into the product. this is an example of showcasing Watson Assistant be integrated with Maximo Manage module
Below diagram presents the architecture view of application flow
High level architecture
Technical Flow
Pre-Requisites for setup
- Maximo Manage module installed and ability to make API requests to the application
- Watson Assistant Project created to upload the code snippet
- Environment to deploy "Flask" or 'IBM Code engine" to setup API's to make requests (API) from Watson Assistant
In this documentation lets explore about the following.
- How to run the application locally
- How to create Docker image
- How to deploy the Docker image in the Code Engine (to access the app remotely)
- Creating Open API using Swagger
- Create Custom Extension in Watson Assistant
- Add Custom Extension to Watson Assistant
- Create Action in Watson Assistant to call the custom extension
To run the application locally follow the below steps.
CLICK ME
-
Download this repo
-
Goto to the root folder of the repo.
-
Do the following steps.
-
Create
.envfile with the below entries. -
Update all the properties accordingly.
LOGLEVEL=INFO
GENAI_API="https://us-xxxxxx.ibm.com/ml/v1/text/generation?version=2023-05-29"
### IBMCloud API Key
GENAI_KEY="xxxxxxx"
GENAI_PROJECT_ID="1c915286-xxxxxxfa4e"
MAXIMO_ATTRRIBUTE_URL="https://xxxxxx.com/maximo/api/os/MXAPIMAXATTRIBUTE?oslc.where=persistent=1%20and%20objectname=%22"
MAXIMO_RUNSQL_URL="https://xxxxxxxxxxxx.com/maximo/api/script/runsql?lean=1&ignorecollectionref=1"
MAXIMO_API_KEY="xxxxxxxxxxxxx"
- Runs the below command to start the app
python main.py
- Open the below urls in a browser to verify the app is running.
- Run the below curl script to test the maximo api.
curl -X 'POST' \
'http://localhost:8080/maximo/' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"query": "What is the worktype of workorder 1309?"
}'
It would give the output like the below.
{
"result": [
{
"WORKTYPE": "PM"
}
]
}
You can create docker images using podman and run the app in the code engine.
Here docker.io is used as a image repository. You can use as per your wish.
In the below example we used gandigit as a docker id. You have to change it to your docker id.
CLICK ME
- Run the below command to login into docker.io
podman login -u gandigit docker.io
- Run the below command to create docker image
podman build --platform linux/amd64 -f Dockerfile -t docker.io/gandigit/maixmo-db-interface:latest .
- Run the below command to push the created image to the repository
podman push docker.io/gandigit/maixmo-db-interface:latest
Lets deploy the created docker image in the Code Engine.
CLICK ME
- In Projects screen, click on
Createbutton
-
Choose
Locationas per your need. -
Enter any Project
Name -
Click on
Createbutton
Project is created.
- Click on the created project
- In Application screen, click on
Createbutton
-
Enter any Application
Name -
Enter the
Docker Image namethat we already created. (latest Image :docker.io/vidishalimbola/maixmo-assist-10-12-24) -
Click on
Configure imagebutton
- Choose
https://index.docker.io/v1/in theRegistry serverdrop down list.
The rest of the details would be auto filled based on the docker image name that we entered in the previous screen.
- Click on
Donebutton in the image configuration screen.
- Click on
Createbutton
- Application got created.
- Click on the application name from the above screen.
The application page get displayed.
- Click on
Configurationtab.
-
Click on
Environment Variablestab. -
Click on
Add environment variablemenu.
-
Choose
Literal valueOption. -
Enter
Environment variable nameandValuecolumns values. -
Click on
AddOption.
-
Click on
AddOption. The variable got created. -
Similarly create an entry for each Environment variables mentioned in the
.env-samplefile.
- Click on
DeployOption to redeploy the app with the created environment variables.
- In the application screen, Click on the
Open URLlink to open the application.
Lets create open API using swagger. This open api json is needed to create extension in Watson Assistant for WA and this app integration.
CLICK ME
-
Open the URL https://converter.swagger.io/ in your browser
-
In the
GET / Convertormethod, click on theTry it outbutton
-
In the
URLtext box enter the App url suffixed withswagger.json
- Click on
Executebutton
The Open API json should have got created.
-
Click on
Downloadbutton -
Open the downloaded json and update the App url as highlighted
The download file may look like this ./files/OpenAPI-Maximo.json
- In the above file you need to change the line no. 10
"url": "https://xxxx.appdomain.cloud"with the appropriate url from the code engine.
Lets create Custom Extension in Watson Assistant to call the app.
CLICK ME
- In Watson Assistant, Click on
Integrationbutton
- Click on
Build custom extensionbutton
- Click on
Nextbutton
- Enter any Name for the extension.
- Click on
Drag and drop file here or click to uploadlink
-
Choose the Open API Json that was generated in the previous section.
-
Click on
Nextbutton
-
See the list of APIs imported.
-
Click on
Finishbutton
Once the Custom Extension is created, it has to be added to WA.
CLICK ME
- In the created Extension, Click on
Addbutton
- Click on
Addbutton
- Click on
Nextbutton
- Click on
Nextbutton
- Click on
Finishbutton
Now this extension can be used in WA.
Lets create action in WA to use this extension.
CLICK ME
CLICK ME
- Click on
Actionsmenu in WA
- Click on
New actionbutton
- Click on
Start from scratchtile
- Enter name for the action.
- Click on
Savebutton
- Click on
customer starts withTile
-
Edit the default start phrase to any. Ex:
Hi -
Click on
Savebutton
CLICK ME
- Click on Step 1 title
-
Enter the text like
Welcome to Maximo Assistant -
Click on
Saveicon -
Click on
New Stepbutton to create new step.
CLICK ME
-
Enter the text like
Enter your Query : -
Click on
Define customer responselink -
Click on
T Free TextOption
- It looks like this.
CLICK ME
-
Click on
New Stepbutton on the above screen -
Enter the text like
Processing your Query ..... -
Click on
Continue to next steplink -
Click on
Use an extensionOption
- Choose
Maximo-Db-InterfaceforExtension - Choose
Post method exampleforOperation - Choose
Tr queryforParameters - In
Tofield chooseAction step variables
- Choose
2. Enter your query:forTofield (This is from the 2nd step)
- It will look like the below.
- Click on
Applybutton
- It will look like the below.
CLICK ME
-
Click on
New Stepbutton on the above screen -
Enter the text like
Here is the response for your Query. ..... -
Click on
Fxicon -
Click on
Maximo-Db-interface (step 3)Option
- Choose
body.result.
The Python app returns JSON with a key called result, which WA retrieved from the Open API uploaded in the extension creation section above
- It will look like the below.
CLICK ME
-
Click on
Previewbutton on the above screen -
Enter the text
Hi(Remember that thecustomer starts withthe step where we entered 'Hi'.)
- It shows 3 options. Choose the action
Gan Maximo Assistantthat we created
- Enter your query
What is the worktype of workorder 1309?
- See the response from the app.


