Maximo

Maximo

Come for answers, stay for best practices. All we're missing is you.

 View Only

Cloning a Maximo Anywhere 7.6.4 Application

By Shane Howard posted Tue March 31, 2020 11:56 PM

  
I started working on a case today regarding cloning Anywhere 7.6.2 applications,  during this I noticed the last blog I had wrote on this was for Maximo Anywhere 7.6.1.  Although still useful for the 7.6.2 and 7.6.3 releases it's no longer relevant for Maximo Anywhere 7.6.4,  which brings us to this blog.   

The cloning process for Maximo Anywhere 7.6.4 is quite simple and I will run through it below using a windows command prompt with the ant and build commands,  you can also do this in eclipse if you wish. 

1.  To start we need to determine the application we want to clone,  I chose Work Execution.   

The command to kick off the cloning script is ant -f anywhere-app-clone.xml as seen below. 


2.  The command will run and prompt you for the application you are cloning,  enter WorkExecution or the application you would like to clone.


Hit enter. 

3.   The next step will prompt you for the destination of your clone,  I'll call my destination MaxClone


4.  You will next be prompted to enter the application title,  this will appear when installing, also the applicationid is used in the application-descriptor.xml and some other configuration files.  (This does not update the title in the app.xml)


Hit enter, the process will now create a new folder under the apps direct as seen below

5.   Now that we have our application, we want to add it to the Anywhere Administration application, before we do this we need to update the admin-config-loader.xml in the IBM\Anywhere\MaximoAnywhere folder

Search for <target name="issuesReturns" and add the following target after its </target> tag.  Ensure you update the instance of MaxClone to match your application folder name. 
     <target name="MaxClone" description="Max Clone loader">
          <antcall target="admin-loader">
               <param name="param.filename" value="${basedir}/apps/MaxClone/artifact/app.xml"/>
          </antcall>
     </target>

Save the file

6.  Now from your command prompt run the admin-config-loader.xml using the following script  ant-f admin-config-loader.xml MaxClone

Once it completes when you log in to Maximo you should see your application in Anywhere Administration as seen below. 

7.  As we can see my app is using my original Shane's Work Execution name, let's update it to a new name so we know this is our cloned app when launching it. 

In your app.xml search for id="applicationName" and update it to the name of cloned application

<message defaultMessage="Maximo Cloned Work Execution" id="applicationName"/>
8.  One last step before we build the application zip file that is uploaded to Maximo is to ensure the appsToBuild property contains your new application,  for example. 


9.  Now run build all from the IBM\Anywhere\MaximoAnywhere folder 

When completed you will see the application uploaded in your new applications deployment tab in Anywhere Administration


10.  Because this is a cloned application we need to build the container as it won't exist on the public app stores.  Before we do this we need to ensure we update the appsToBuild value in the IBM\Anywhere\MaximoAnywhereAppCntr\container.properties is updated.



11.  Now we are on the last step,  run build all from the IBM\Anywhere\MaximoAnywhereAppCntr folder when the command completes you will now have an application file in your bin folder similar to what you see below. 


and that's it! 

We can now take this apk, install it on our device and launch our cloned application as I have done below. 



I hopes this helps out a bit with the new cloning process,  if you have any questions please let me know and post a comment below. 
 




#Maximo
#MaximoAnywhere
#AssetandFacilitiesManagement
3 comments
106 views

Permalink

Comments

Thu June 18, 2020 01:53 AM

Hi Shane,

Thanks for your Cloning a Maximo Anywhere 7.6.4 Application blog.

I'm facing the issue at last step build .apk file, the .apk file fails at the checksum of cloned application. find the log details.

[INFO]  2020-6-17 17:44:2   [EnvWorkExecution::android]  Initializing App EnvW
orkExecution for platform android--
  [INFO]  2020-6-17 17:44:2   Initializing App EnvWorkExecution
  [INFO]  2020-6-17 17:44:20   Initializing app directory
  [ERROR]  2020-6-17 17:44:22   npm
  [ERROR]  2020-6-17 17:44:22    notice created a lockfile as package-lock.json.
 You should commit this file.

  [ERROR]  2020-6-17 17:44:22   npm WARN com.ibm.iot.maximoanywhere.envworkexecu
tion@7.6.4 No repository field.
npm WARN com.ibm.iot.maximoanywhere.envworkexecution@7.6.4 license should be a v
alid SPDX license expression


up to date in 0.553s

  [INFO]  2020-6-17 17:44:22   up to date in 0.553s

  [INFO]  2020-6-17 17:44:22   Prepare entry page
Error: ENOENT: no such file or directory, open 'C:\Test\MaximoAnywhereAppCntr\ou
tput\EnvWorkExecution\www\EnvWorkExecution.checksum'
    at Object.openSync (fs.js:458:3)
    at Object.readFileSync (fs.js:360:35)
    at InitAppAndroid.editWebIndexHtml (C:\Test\MaximoAnywhereAppCntr\scripts\in
itialize\init-app.js:182:31)
    at C:\Test\MaximoAnywhereAppCntr\scripts\initialize\init-app.js:442:32
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async Object.build (C:\Test\MaximoAnywhereAppCntr\scripts\container.js:58
7:43) {
  errno: -4058,
  syscall: 'open',
  code: 'ENOENT',

Pl provide your suggestions. 

Regards,
Raj Kumar

Mon June 01, 2020 05:32 PM

Shane,

Great article can you tell us what is different when it is an iOS based application. If you can walk through the steps to build the container for iOS that would be great.

Question then is - once the container (ipa file) is generated can this now be edited similar to how the OOB app store based apps can be or de ALWAYS now have to edit it on the mac and build a new container (ipa) every time we modify the app for example add a new attribute or validation.

Thanks

Ken
Thanks

Mon April 13, 2020 08:54 AM

With this version, how can we do preview during our development lifecycle without installing the apk in our mobile. As the development testing with this process will take too much of time without preview option.  
The knowledge center page doesn't properly document how to setup development environment like earlier version.