↓ Skip to main content
Two paths to a first Maximo Mobile app, drawn as geometric shapes

Hello World in Maximo Mobile

Your First Maximo Mobile App - This article is part of a series.
Part 3: This Article
Most frameworks have a command that creates an empty project: create-react-app, ng new, dotnet new. Maximo Mobile has none. A new app starts as a copy of an app that IBM ships, and you cut that copy down until one page is left. This post walks that path in Application Configuration, the editor that IBM builds into Maximo Application Suite.

MAS 9.2 series Application Configuration

This is the third post in a series. The first, Understanding Your First Maximo Mobile App, maps the files, and the second, MAML Basics, covers the language. This one gets something running.

Why every app starts as a copy
#

A Maximo Mobile app is a folder of source, and it is also a registration on the server. The server records that the app exists and that it is a mobile app. It records which object structures the app takes offline and where its tile sits in the navigator. Source files alone cannot create any of that. IBM’s own extension for MAF development in VS Code says the same: its repository lists “Cannot create or clone applications” among its limits, and sends you to Application Configuration.

So the path to your own app runs through an app that already has a registration:

  1. Duplicate a shipped app. The server registers the copy as a new app.
  2. Strip the copy down to one page in the XML editor.
  3. Preview it in the browser.
  4. Publish it, give it to a security group, and open it on a device.

Hello World in Maximo Mobile is therefore a subtraction. You start with a complete app, and you delete your way down to one page.

From a shipped app to your own tile on the device From a shipped app to your own tile on the device
From a shipped app to your own tile on the device

Before you start
#

  • A MAS system that you are allowed to break. We use our own development system for this.
  • Application Configuration enabled. From MAS 9.1 on, it runs inside the suite, and an administrator sets it up in the Admin dashboard. On MAS SaaS it is off by default, and IBM enables it on request.
  • A user who may publish. IBM’s documentation asks for an API key in Maximo Manage for every user who publishes apps, and for a correct mxe.oslc.webappurl system property.
The Application list of Application Configuration in MAS, filtered to SRMOBILE. The More actions menu at the end of its row is open, with the entries Duplicate, Redownload, Delete and History.
The application list in Application Configuration, with More actions open on the row of SRMOBILE

The path
#

  1. Duplicate a small app

    step 1

    Pick a small source app, because everything you copy you will delete again. We duplicated SRMOBILE, the service request app.

    In the application list, find the source app and open More actions at the end of its row. Choose Duplicate, give the copy a unique name and a description, and click Duplicate. Our copy is FSSTARTM.

    A mobile app also needs mobile download. On our 9.2 system the Duplicate dialog shows that switch, and it cannot be changed there. Check it after the duplicate: Edit on the copy’s row opens Configure application, where the switch can be changed. Our FSSTARTM shows it on.

    The copy inherits the security settings of the source app, and the module stays the one of the source. IBM’s documentation suggests a very small app such as APIKEY when your new app looks like nothing that exists. For a mobile app, a small mobile source such as SRMOBILE is the shorter way.

    Our first choice was TECHMOBILE, the technician app. On our system its duplicate failed with a server error. The failed attempt also left a temporary folder for the new app id on the server, and every further duplicate to that id failed until our administrator removed the folder. After that, the duplicate from SRMOBILE went through.

    The Duplicate application dialog over the list, with the application name FSSTARTM, the brief description Homepage Apps Starter, the switch Enable mobile download shown as No and read-only, and the buttons Cancel and Duplicate.
    The Duplicate dialog: name and description; the mobile download switch is read-only here
    The Configure application dialog of FSSTARTM, with the description Homepage Apps Starter (mobile) and the switch Enable mobile download set to Yes.
    Configure application, opened with Edit on the copy’s row: here the mobile download switch can be changed
  2. Preview it untouched

    step 2

    Open the copy and click Preview before you change anything. Application Configuration starts a preview server and loads the app in a new browser tab. When the untouched copy fails here, the problem is the environment, and you want to know that before the first change.

    The first start takes a few minutes. IBM’s documentation warns against a publish while the preview server is still starting, so wait for the console message that says the server is available.

  3. Strip it to one page

    step 3

    Select app.xml in the file list of the editor. Now delete everything that one page does not reach: the other pages, their dialogs and the datasources that only those pages use.

    Two things stay in the manifest, because a mobile app needs them:

    • theme="touch" on the root element.
    • A <menu slot="navigation-items"> with one entry. That menu puts a tile on the device. An app without it publishes fine and never appears in the navigator.

    The canvas next to the XML editor shows the page as you change it, and a click on an element there highlights its XML. Click Save when the page is down to what you want.

    The Application Configuration editor of FSSTARTM, with the navigator on the left and app.xml in the code editor: the maximo-application root with theme touch and navigator-tile-order 350, a menu with one menu-item, and pages with one page fs_hello that points to its own file.
    app.xml of FSSTARTM in the code editor of Application Configuration. Today its page lives in its own file
  4. Preview again

    step 4

    Click Preview again. The preview is a working app in the browser, so you can tap through the page and see the data that it loads.
  5. Publish and assign

    step 5

    Click Publish. Each publish creates a new revision, and the History entry in the More actions menu lists them with date, user, version and status.

    On the first publish, add the app to the security groups that should see it. After that, mobile devices can download the new version.

  6. Log in again, then open it

    step 6

    Log out of MAS and in again, and do the same in Maximo Mobile on the device. Both read the signature options at login and keep them for the session. On our system the new app was missing from the navigator until we logged in again. A new web app answered 403 in MAS for the same reason.

    Then open the navigator on the device and tap the tile.

    Here is FSSTARTM at tablet width, in the preview of our MAF editor, with the bar of the touch theme at the bottom. It has grown since the first publish: the page now lives in a shared folder, and a web twin of the app includes the same page.

    The Hello page of FSSTARTM at tablet width: the header Hello from the shared folder, three lines that say where the page lives, that it runs in a local preview and that it was built on a workstation, and a short list of three steps. At the bottom the black bar of the touch theme.
    FSSTARTM at tablet width, in the preview of our MAF editor

What is left at the end
#

The manifest of a one-page app is short. Ours keeps the root element, one menu entry and one page:

<maximo-application controller="AppController" default-log-level="error" id="FSSTARTM" mas-id="manage" navigator-tile-order="350" product-name="Maximo" product-name-adaptive="Maximo" theme="touch" title="Homepage Apps Starter" user-menu-enabled="true" nav-initial-open-state="false" user-profile-enabled="true" version="9.2.120.0">
  <menu slot="navigation-items" id="navmenu">
    <menu-item id="navitem" label="Homepage Apps Starter" icon="maximo:inventory-counting" page="fs_hello"/>
  </menu>
  <pages id="pages">
    <page id="fs_hello">
      <header-template id="fs_hdr" title="Hello World"/>
      <box id="fs_body" direction="column" padding="1">
        <label id="fs_intro" label="This page is the whole app."/>
      </box>
    </page>
  </pages>
</maximo-application>

Read it from the outside in:

  • The root element carries the app id, the touch theme and the version.
  • The menu with slot="navigation-items" is the tile on the device.
  • The page holds a header and a box with one label.

Preview is the browser, publish is the device
#

The preview runs the app in a browser tab. That is fast, and it skips every check that only applies on a device. An app can look fine in the preview and still fail at publish or on the device. A <table> without use-with-mobile="true" is the classic case.

When a publish fails, download the publish log from the editor. Application Configuration keeps the preview and publish logs until you close the editor.

Some mistakes pass the preview and the publish. Only the running app shows these:

  • An unknown attribute is ignored.
  • A binding to a datasource id that does not exist renders blank.
  • A wrong object structure and an invalid where clause fail at run time.

Before you publish again
#

The device keeps its copy of an app until the version changes. The server counts a new revision on every publish, and the navigator compares versions. So before a republish that you want to see on a device, raise version on the root element in app.xml.

A route that looks like it works
#

Older guides describe another way to create an app: a clone and an upload through the OSLC API. That route writes the application record and skips the mobile registration. The app installs, and its tile appears in the navigator. On the 9.1 series it then failed on the device with “Connect / Authentication failed”.

Create a mobile app with Duplicate in Application Configuration. On 9.1 the OSLC clone looked successful and failed later, on a device.

Where to go from here
#

You now have a working app with your own id, and an empty page to fill. Next come datasources, because almost everything else in MAF hangs off them.

Earlier in this series: Understanding Your First Maximo Mobile App and MAML Basics.


Working on a Maximo Mobile rollout and want the parts of this that do not fit in a blog post? Get in touch.

Your First Maximo Mobile App - This article is part of a series.
Part 3: This Article