Maximo Open Forum

 View Only
  • 1.  is there any way to stop a workflow through API OSLC call?

    Posted 04-23-2021 03:53
    is there any way to stop a workflow through API OSLC call? 

    I am trying to call workflow and stop the workflow ? Please hep me ifthis can be possible through API post method?
    #Integrations

    ------------------------------
    Pradeep Rout
    TCSL
    ------------------------------


  • 2.  RE: is there any way to stop a workflow through API OSLC call?

    Posted 04-26-2021 09:47
    Routing a workflow is easy (interactive progression is more involved but also doable) and can be found here: Maximo_NextGen_REST_API_-_nextgen.pdf (ibm.com)

    Regarding stopping, for clarity, you're talking about the "Stop Workflow" action that users can invoke in the UI, correct? I'm not aware of an API call that can be made out of the box to stop a workflow instance. That being said, it shouldn't be too difficult to write an automation script that you would call from a REST API that would stop the workflow.

    If you've never created a script that gets invoked via the REST API, you can either tie it to a specific object structure as an action or just create a script with no launch point. Assuming you go the script with no launch points, you'll have two implicit variables. The variable "request" will be an OslcRequest object which exposes functions like request.getQueryParam("paramname") if you're providing the arguments as query parameters or request.getHeader("headername") if you're providing headers. If you want to build a JSON body to return, you can utilize the responseBody implicit variable. 

    Once you get the workflow instance MBO you want to stop (being aware that a single record can technically be in more than one workflow), I think you can just call stopWorkflow(memo).

    ------------------------------
    Steven Shull
    Projetech Inc.
    ------------------------------