IBM Support

A REST call for the workflow STOP node gives back 400 status code with system#invalidfetch message in the response.

Question & Answer


Question

Why does a REST POST call made to the STOP workflow Node returns with "system#invalidfetch" error and statusCode 400?
Steps followed to get this error are as follows:

STEPS TO REPRODUCE:
(A) Pre-reqs: Prepare a workflow, then validate, enable, and activate it.
-Process Name: SR_WFLOW12; Object: SR; Save; Notice, 1 Start and 1 Stop node is already present
-Drag 1 Condition node; 1 Stop Node; 2 Task Nodes; 2 Input Nodes; 2 Interaction Nodes to the workflow designer canvas
-Perform following actions on each node: 
1) START NODE 
-Positive Line to a Condition
2) Condition Node
-Title-> REPORTED BY PRIORITY =4; Description-> REPORTED BY PRIORITY =4
-Expression-> :reportedpriority=4
-Positive Line to Task->TASK 5
-Negative Line to STOP1
3) STOPNODE
-Title->STOP1
4) Task Node
-Title-> TASK 5; Description-> TASK 5
-Application-> SR
-Under Assignments-> RoleID-> ORIGINATOR
-Perform Accept Action-> When any assignment is accepted
-Positive Line to Task->INPUT 7
-Negative Line to INTERACTION 9    
5) Input Node
-Title-> INPUT 7; Description-> INPUT 7
-Positive Line to INPUT 8
-Positive Line to INTERACTION 9

6) Interaction Node
-Title-> INTERACTION 9
-Directions Title-> Primary interaction; Directions Body: Primary interaction
-Positive Line to INTERACTION 10

7) Interaction Node
-Title-> INTERACTION 10
-Directions Title-> Secondary interaction; Directions Body: Secondary interaction
-Positive Line to Task Node-TASK 6
8) Input Node
-Title-> INPUT 8; Description-> INPUT 8
-Positive Line to Task Node-TASK 6
-Positive Line to Stop Node - STOP2

9) Task Node
-Title-> TASK 6; Description-> TASK 6
-Application-> SR
-Under Assignments-> RoleID-> ORIGINATOR
-Perform Accept Action-> When any assignment is accepted
-Positive Line to Stop Node - STOP2
10) From More Actions; Add workflow to Application: SR
11) Create a Service Request; TEST1; Priority: 4; Take Ownership; Route the workflow to the TASK 5 node

(B) Perform REST Queries to see the issue.
(1) Make a REST GET Request
GET URL
http://localhost:9080/maximo/oslc/os/mxapiwfassignment?_lid=maxadmin&_lpwd=maxadmin&oslc.select=*&lean=1&oslc.where=ownertable="SR"&oslc.where=owner="maxadmin"
RESPONSE
Observe the workflow is at the TASK 5 node and it shows in the response 1 positive line to INPUT 7 Node and 1 negative line to INTERACTION 9 Node along with href link

{
    "member": [
        {
            "wfaction_collectionref": "http://localhost/maximo/oslc/os/mxapiwfassignment/_NjkvNS9TUl9XRkxPVzEyLzEvMjg0/actions",
            "keeporigassgn": false,
            "wfassignmentid": 205,
            "roleid": "ORIGINATOR",
            "separategroups": true,
            "description": "TASK 5",
            "startdate": "2021-03-19T04:06:58-04:00",
            "assignstatus": "ACTIVE",
            "calendarbased": false,
            "assignstatus_description": null,
            "_rowstamp": "6176496",
            "wfaction": [
                {
                    "wfactionid": 766,
                    "_rowstamp": "6174926",
                    "ownernodeid": 5,
                    "localref": "http://localhost/maximo/oslc/os/mxapiwfassignment/_NjkvNS9TUl9XRkxPVzEyLzEvMjg0/actions/0-766",
                    "membernodeid": 9,
                    "instruction": "INTERACTION 9",
                    "actionid": 6,
                    "href": "http://childkey#V0ZBU1NJR05NRU5UL1dGQUNUSU9OLzYvU1JfV0ZMT1cxMi8x",
                    "ispositive": false
                },
                {
                    "wfactionid": 765,
                    "_rowstamp": "6174925",
                    "ownernodeid": 5,
                    "localref": "http://localhost/maximo/oslc/os/mxapiwfassignment/_NjkvNS9TUl9XRkxPVzEyLzEvMjg0/actions/1-765",
                    "membernodeid": 7,
                    "instruction": "INPUT 7",
                    "actionid": 5,
                    "href": "http://childkey#V0ZBU1NJR05NRU5UL1dGQUNUSU9OLzUvU1JfV0ZMT1cxMi8x",
                    "ispositive": true
                }
            ],
            "href": "http://localhost/maximo/oslc/os/mxapiwfassignment/_NjkvNS9TUl9XRkxPVzEyLzEvMjg0",
            "nodeid": 5,
            "wfid": 284,
            "app": "SR",
            "origperson": "MAXADMIN",
            "processname": "SR_WFLOW12",
            "ownerid": 429,
            "ownertable": "SR",
            "templateid": "WFASSIGN",
            "timelimit": 0,
            "duedate": "2021-03-19T04:06:58-04:00",
            "assigncode": "MAXADMIN",
            "emailnotification": false,
            "assignid": 69,
            "processrev": 1
        }
    ],
    "href": "http://localhost/maximo/oslc/os/mxapiwfassignment",
    "responseInfo": {
        "href": "http://localhost/maximo/oslc/os/mxapiwfassignment?_lid=maxadmin&_lpwd=maxadmin&oslc.select=*&lean=1&oslc.where=ownertable=%22SR%22&oslc.where=owner=%22maxadmin%22"
    }
}
(2) Perform a POST call using the href link with action=wsmethod:completeAssignment 
POST
http://localhost:9080/maximo/oslc/os/mxapiwfassignment/_NjkvNS9TUl9XRkxPVzEyLzEvMjg0?action=wsmethod:completeAssignment
    HEADERS
        x-method-override: PATCH
    BODY
        {
            "memo":"some memo",
            "accepted":true
        }

RESPONSE
Observe there are 2 actions shown here in the Response body, Both positive. 1 for INPUT 8 and another for INTERACTION 9.
And the response headers contain some parameters along with a url shown in the parameter called Location.
RESPONSE BODY
{
    "nodetype": "INPUT",
    "internalnodetype": "WFINPUT",
    "member": [
        {
            "wfactionid": 767,
            "sequence": 1,
            "ownernodeid": 7,
            "membernodeid": 8,
            "instruction": "INPUT 8",
            "processname": "SR_WFLOW12",
            "actionid": 7,
            "href": "null/0-767",
            "ispositive": true,
            "processrev": 1
        },
        {
            "wfactionid": 768,
            "sequence": 2,
            "ownernodeid": 7,
            "membernodeid": 9,
            "instruction": "INTERACTION 9",
            "processname": "SR_WFLOW12",
            "actionid": 8,
            "href": "null/1-768",
            "ispositive": true,
            "processrev": 1
        }
    ],
    "responseInfo": {
        "href": "http://localhost/maximo/oslc/os/mxapiwfassignment/_NjkvNS9TUl9XRkxPVzEyLzEvMjg0?action=wsmethod:completeAssignment",
        "totalCount": 2
    }
}
RESPONSE HEADERS
cache-control - >no-cache
content-language - >en-US
content-length - >595
content-type - >application/json
date - >Fri, 19 Mar 2021 08:10:39 GMT
location - >http://localhost/maximo/oslc/wf/mxapiwfassignment_71328
x-content-type-options - >nosniff
x-frame-options - >SAMEORIGIN
x-xss-protection - >1

 
(3) Perform a POST call using the LOCATION link returned earlier for the actionid: 7 which is for INPUT 8 Node
POST 
http://localhost:9080/maximo/oslc/wf/mxapiwfassignment_71328
    HEADERS
        x-method-override: PATCH
    BODY
        {
            "actionid": 7,
            "memo":"To INPUT 8 NODE"
        }
RESPONSE BODY
{
    "nodetype": "INPUT",
    "internalnodetype": "WFINPUT",
    "member": [
        {
            "wfactionid": 772,
            "sequence": 1,
            "ownernodeid": 8,
            "membernodeid": 6,
            "instruction": "TASK 6",
            "processname": "SR_WFLOW12",
            "actionid": 12,
            "href": "null/0-772",
            "ispositive": true,
            "processrev": 1
        },
        {
            "wfactionid": 773,
            "sequence": 2,
            "ownernodeid": 8,
            "membernodeid": 2,
            "instruction": "STOP 2",
            "processname": "SR_WFLOW12",
            "actionid": 13,
            "href": "null/1-773",
            "ispositive": true,
            "processrev": 1
        }
    ],
    "responseInfo": {
        "href": "http://localhost/maximo/oslc/wf/mxapiwfassignment_71328",
        "totalCount": 2
    }
}

RESPONSE HEADERS
cache-control - >no-cache
content-language - >en-US
content-length - >529
content-type - >application/json
date - >Fri, 19 Mar 2021 08:17:50 GMT
location - >http://localhost/maximo/oslc/wf/mxapiwfassignment_71328
x-content-type-options - >nosniff
x-frame-options - >SAMEORIGIN
x-xss-protection - >1
(4) Perform a POST call using the LOCATION link returned earlier for the actionid: 13 which is for STOP 2 node.
POST 
http://localhost:9080/maximo/oslc/wf/mxapiwfassignment_71328
    HEADERS
        x-method-override: PATCH
    BODY
        {
            "actionid": 13,
            "memo":"FROM NPUT 8 NODE to STOP 2 NODE"
        }
RESPONSE BODY
{
    "Error": {
        "reasonCode": null,
        "message": "system#invalidfetch",
        "statusCode": "400"
    }
}
RESULT:  A message: "system#invalidfetch" with statusCode: "400" is received.
EXPECTED RESULT:  REST POST call performed for the STOP Node should complete succesfully without any error.
 

Cause

An APAR is created to fix the code addressing this issue.
APAR Number: IJ33585

[{"Type":"MASTER","Line of Business":{"code":"LOB59","label":"Sustainability Software"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SSLKT6","label":"IBM Maximo Asset Management"},"ARM Category":[{"code":"a8m0z000000GnTwAAK","label":"Workflow->General"}],"ARM Case Number":"TS005543421","Platform":[{"code":"PF016","label":"Linux"},{"code":"PF033","label":"Windows"}],"Version":"7.6.0;7.6.1"}]

Product Synonym

Maximo Asset Management

Document Information

Modified date:
05 July 2021

UID

ibm16469435