Maximo

 View Only
Expand all | Collapse all

Calling application actions Ex.(Apply SLA - Create Workorder) through the app.xml or appcustomization.js

  • 1.  Calling application actions Ex.(Apply SLA - Create Workorder) through the app.xml or appcustomization.js

    Posted 5 days ago

    Hello everyone,

    Did anyone try or found a way calling application actions within the maximo application framework? so for example if am on SRMOBILE can i call the actions that already exists in service requests within Manage itself like Apply SLA, Create workorder etc.. whether that was from the app.xml or  appcustomization.js

    Thanks in advance



    ------------------------------
    Mostafa Mosaad
    Software Engineer
    Megasoft
    Cairo
    01117275779
    ------------------------------


  • 2.  RE: Calling application actions Ex.(Apply SLA - Create Workorder) through the app.xml or appcustomization.js

    Posted 4 days ago

    Hi Mostafa,

    I'm curious about the business case for this requirement. Wouldn't it be better to create the SR on mobile, and once it's synced, you apply the SLA in Manage? If you're offline, you won't be able to call any Manage action anyway. Alternatively, you will need to sync your SLAs and build a custom logic in Mobile to apply an SLA, which I think is very complex to handle in Mobile.



    ------------------------------
    If this post helps, please consider accepting it as a solution to help other members find it more quickly.

    Maycon Belfort
    Consultant
    BPD Zenith
    Melbourne
    ------------------------------



  • 3.  RE: Calling application actions Ex.(Apply SLA - Create Workorder) through the app.xml or appcustomization.js

    Posted 4 days ago

    Hi Maycon,

    Thanks for your response. My exact point is this:

    From the SR Mobile app, I want to implement custom logic where the user can reopen a resolved ticket if the issue persists, providing a reopening reason directly in the app. I've already created a button on the SR card that opens a dialog, captures the reason, updates the ticket status, and sets the corresponding attribute (reopening reason) in the ticket object.

    While I understand that SLAs and follow-up work orders can be managed from  Manage using workflows or scripts, my requirement is to perform all these actions directly from the SR Mobile app. Specifically, I am exploring the capability of calling Manage application actions-like creating a follow-up work order-directly within appcustomization.js in SR Mobile.

    Do you know if this level of integration with Manage actions is possible in SR Mobile?



    ------------------------------
    Mostafa Mosaad
    Software Engineer
    Megasoft
    Cairo
    01117275779
    ------------------------------



  • 4.  RE: Calling application actions Ex.(Apply SLA - Create Workorder) through the app.xml or appcustomization.js

    Posted 4 days ago

    Hi Mostafa,

    There could be multiple ways in which a service request is created, through the Service Requests application, via Email Listener, through an integration, through a self service app, via the SRMobile, via another mobile application, from another Maximo application. All of these SRs potentially need an SLA being applied, so why not look for a common method, either an Escalation, or auto-initiate a small Workflow that applies the SLA and then Stops.

    Regards - Andrew



    ------------------------------
    Andrew Jeffery
    Maximo SME
    ZNAPZ b.v
    Barnstaple
    +44 (0)777 1847873
    ------------------------------



  • 5.  RE: Calling application actions Ex.(Apply SLA - Create Workorder) through the app.xml or appcustomization.js

    Posted 4 days ago

    Hi Andrew,

    Thank you for your insights. While I completely understand the benefits of applying a common method like an Escalation or auto-initiating a small Workflow to handle SLAs and follow-up actions after the SR is created, my focus in this case is slightly different.

    I am looking to implement this logic directly within the SRMobile app, specifically in the app.xml or appcustomization.js files. My goal is to allow the user to perform actions like reopening a resolved ticket (with a reason) and even creating a follow-up work order-all from the SRMobile app interface, without relying on Manage actions after syncing.

    I've already implemented a button on the SR card to capture the reopening reason, change the ticket status, and update the relevant attributes. Now, I am exploring the feasibility of integrating more advanced actions, such as creating follow-up work orders, entirely from the SRMobile app.

    Is there a way to call specific Manage application actions directly from the SRMobile app to achieve this, or would such an approach require custom APIs or additional configurations?

    Looking forward to your thoughts on this.

    Best regards,
    Mostafa



    ------------------------------
    Mostafa Mosaad
    Software Engineer
    Megasoft
    Cairo
    01117275779
    ------------------------------



  • 6.  RE: Calling application actions Ex.(Apply SLA - Create Workorder) through the app.xml or appcustomization.js

    Posted 4 days ago

    Hi Mostafa

    Sorry I don't know the answer, I am functional rather than technical. Changing status on SR Mobile is deliberately not possible because it is an application that does not consume AppPoints. Therefore customising this capability will place your client in an ackward position if they were audited by IBM for license compliance. Let us say that there are 1000 self-service users who are found to have this change status capability, then I think IBM will be asking the client to add 2000 AppPoints to their registry, Authorized Limited User I think is 2 AppPoints. Your client will be in a bit of a battle, and they will probably be blaming your company for providing the functionality to flout licensing rules. Therefore, I'm sorry but this is a dangerous path you are following.

    The argument which IBM can make is that you changed the profile of the application so much that it would now be considered a 3rd party mobile application which requires a Limited license.

    What we need is the Maximo Mobile Approver app to have the same functionality as the old Supervisors Work Center which allowed the processing of Service Requests and turning them into Work Orders. That Maximo Mobile app is under the Limited license which does consume AppPoints, but then would probably be used by a smaller population of users.

    This is a conversation I've had with others before, so this time I thought I had better put my thoughts on paper, although I am sure it isn't what you wanted to hear.

    Regards - Andrew



    ------------------------------
    Andrew Jeffery
    Maximo SME
    ZNAPZ b.v
    Barnstaple
    +44 (0)777 1847873
    ------------------------------



  • 7.  RE: Calling application actions Ex.(Apply SLA - Create Workorder) through the app.xml or appcustomization.js

    Posted 4 days ago

    I 100% agree with Andrew. Having this in Manage would be simpler and better. You can add a field asking if a follow-up WO needs to be generated and handle this in Manage. As the user would only update the SR details, I believe it wouldn't impact the licensing (needs confirmation).

    However, if you still think you need this, I'd try the following approach.

    1. In Maximo, you can add an action to the MXAPISR object structure, More Actions --> Action Definition.
    2. Add an action and give it a name.
    3. In the implementation type, try wsmethod and check if you can see the apply SLA option in the Method Name field.
      • Optionally, you can add a sigoption to control this via security group.
    4. If you can't select the Apply SLA option, change the implementation type to script
    5. Create an automation script for integration using the Object Structure MXAPISR and write a code to apply the SLA, create follow up WO, etc.
    6. Select the automation script in the Script field of the Action Definition and Save.

    You can check the detailed steps here: https://ibm-maximo-dev.github.io/maximo-restapi-documentation/action/action/

    In Maximo Mobile, you'll need a button to trigger the action, so you can use the same button you already have created to save the changes.

    In your button action, you can add something like this:

    async buttonAction (evt) {
        let action = 'ACTION NAME'; // the action name defined in the Object Structure
        let item = evt.item; // assuming you have added the item to your button on-click-args
        let datasource = this.app.findDataSource('YOUR DS NAME');
    
        let option = {
          record: item,
          headers: {
            'x-method-override': 'PATCH',
          },
          responseProperties: 'ticketid', // or any additional attribute from SR you want
          localPayload: {
            href: item.href,
            ticketid: item.ticketid,     // use one of them depending on the datasource key attribute you have
            ticketuid: item.ticketuid,
          },
          query: { interactive: false }, // you may want to change this to true
        };
        
        try {
          await datasource.invokeAction(action, option);
        } catch (error) {
          this.app.log.log(error); // print the error msg in the log files
        }

    I haven't tested this at all, but it's a start. Good luck.



    ------------------------------
    If this post helps, please consider accepting it as a solution to help other members find it more quickly.

    Maycon Belfort
    Consultant
    BPD Zenith
    Melbourne
    ------------------------------



  • 8.  RE: Calling application actions Ex.(Apply SLA - Create Workorder) through the app.xml or appcustomization.js

    Posted 4 days ago

    Hi Maycon,

    Thank you so much for providing this detailed solution and the step-by-step guidance! I truly appreciate the effort and thought you've put into this. Your approach offers a clear starting point, and I'll definitely test it out to see how it works in my scenario.

    To clarify, I'm discussing the general concept of invoking app actions within appcustomization.js, rather than focusing specifically on the SRMOBILE app. My aim is to explore the feasibility of triggering such actions dynamically across different apps within this framework.

    Thanks again for your time and valuable insights!

    Best regards,



    ------------------------------
    Mostafa Mosaad
    Software Engineer
    Megasoft
    Cairo
    01117275779
    ------------------------------



  • 9.  RE: Calling application actions Ex.(Apply SLA - Create Workorder) through the app.xml or appcustomization.js

    Posted 3 days ago

    Hi Mostafa

    This is an interesting requirement, so let me add my 2 cents. Actions like Apply SLA, Create Follow Up WO are all server-side actions, as I understand. They don't run on the client. So if you need to invoke them, you will need to call the method on the server, and the server would need the data in the database first.

    I don't think you will be able to call these methods directly from your JavaScript, because even if you invoke them, the logic would run on the server, and this would mean that you would need to save and sync your data first.

    If I understand correctly, your intent is to run this logic on client side, within your JavaScript. This would mean that you would need to replicate all the existing server-side logic into your JavaScript. You would also need access to SLA commitments etc, and you would need a local copy of this data.

    This is just my 2 cents, but I think this could be quite a bit complicated. I think the easiest solution would be to sync your data first, and then invoke the server-side logic. Ofcourse, this would mean that you need connectivity.

    Cheers



    ------------------------------
    Aneesh Joseph
    Director and Solutions Architect
    objec3d
    Melbourne, Australia
    https://www.objec3d.com
    ------------------------------



  • 10.  RE: Calling application actions Ex.(Apply SLA - Create Workorder) through the app.xml or appcustomization.js

    Posted yesterday

    Hi Aneesh,

    Thank you for your detailed and thoughtful response. I truly appreciate you taking the time to share your insights and perspective on this requirement.

    You've made some excellent points about the server-side nature of actions like Apply SLA and Create Follow Up WO. Your explanation about the need for syncing data and the complexities involved in replicating server-side logic on the client side is both clear and insightful. I can see how this approach would require significant effort and might introduce additional challenges.

    Thanks again for your valuable input, and I'll be sure to reach out if there are any further developments or questions.

    Cheers,
    Mostafa



    ------------------------------
    Mostafa Mosaad
    Software Engineer
    Megasoft
    Cairo
    01117275779
    ------------------------------



  • 11.  RE: Calling application actions Ex.(Apply SLA - Create Workorder) through the app.xml or appcustomization.js

    Posted 4 days ago

    Hi Andrew,

    Thank you very much for your response and the valuable insights you've shared. I truly appreciate the detailed explanation regarding licensing implications and the considerations surrounding application customization.

    To clarify, my inquiry was more about understanding the general concept of invoking app actions within the appcustomization.js framework. The intent is not specifically tied to the SRMOBILE app but rather to explore whether the same concept could apply to other applications, such as a Technician app or even something like inventory management. I completely understand and respect the licensing constraints you mentioned, and I certainly don't intend to propose a path that could create compliance issues for our clients.

    Your explanation has been incredibly helpful in framing these considerations. Thanks again for your thoughtful response and for taking the time to put your insights on paper-it's greatly appreciated!

    Best regards



    ------------------------------
    Mostafa Mosaad
    Software Engineer
    Megasoft
    Cairo
    01117275779
    ------------------------------