BPM, Workflow, and Case

BPM, Workflow, and Case

Come for answers. Stay for best practices. All we’re missing is you.

 View Only
  • 1.  Undeclared local variable

    Posted Thu December 31, 2020 09:12 AM
    Dear colleagues!

    I am using BPM version 8.6.0. BPM requests go through a middleware (Spring Boot, JAVA 8). A request comes to the middleware and this request is sent to the BPM. The task_id middleware gets by process_id from the cache.
    I have a problem. When I use middleware, sometimes there is a problem - error <<Undeclared local variable, input or output parameter "parameter_name" found in service "Task_name" item "UNKNOWN" location "UNKNOWN". You must declare it in order to use it>>.

    The error says that "undeclared variable" was sent, however, task output is correct and checked many times. The correct variables are sent to the correct task.

    Sometimes it works propertly but not from the first time. It takes several tries.

    I don't have this problem while using BPM instruments (debug/test)


    Does anyone faced this problem and how to solve it?

    Best regards, Bekzod Abduraimov

    ------------------------------
    Bekzod Abduraimov
    ------------------------------


  • 2.  RE: Undeclared local variable

    Posted Thu December 31, 2020 10:13 AM
    Hi Bekzod,

    The middleware context is not fully clear to me. Please could you explain how are you passing data between BPM and middleware ?
    Are you accessing any variable like - tw.system.findProcessInstanceByID(<Instance_ID>).businessData ? 
    Also, can you provide any screenshot of the implementation ?


    ------------------------------
    Atanu Roy
    ------------------------------



  • 3.  RE: Undeclared local variable

    Posted Fri January 01, 2021 12:43 PM
    Hi, Atanu. Thank you for responding!

    I use IBM BPM Process RestAPI (/bpm/explorer/).

    1. Start the process - GET /processes
    2. Get all process tasks - GET /user-tasks. Get the last task with the state is ready.
    3. Trying to complete the task - POST /user-tasks/{task_id}/complete

    The problem arises in the third step.

    ------------------------------
    Bekzod Abduraimov
    ------------------------------



  • 4.  RE: Undeclared local variable

    Posted Mon January 04, 2021 01:31 AM
    Edited by Thong Huynh Wed January 13, 2021 09:04 PM
    Hi Bekzod,

    Without having to look into what's happening at your middleware level, this error message is pretty obvious isn't it?

    <<Undeclared local variable, input or output parameter "parameter_name" found in service "Task_name" item "UNKNOWN" location "UNKNOWN". You must declare it in order to use it>>.

    BPM is saying that you're using a private variable 'parameter_name' which has not been created. 

    Sometimes there are caching issues with BPM in which it always work for me to recreate the service manually. 

    So I'd suggest you:
    - Check and make sure 'parameter_name' is available or don't use it if you're not intending to
    - Try to recreate the service manually (don't copy) and retry

    Regards,
    Thong

    ------------------------------
    Thong Huynh
    Sydney NSW
    ------------------------------