Skip to main content
steffena0001
January 7, 2022
Question

pass an auto increment primary key field to sub process

  • January 7, 2022
  • 4 replies
  • 0 views

I have a PK field called requestId under request Entity. I want to pass the value of this requestId to the subprocess.

I already tried making the subprocess synchronous and also tried putting stored values to a process variable but to no avail.

context: requestId is a PK that gets auto-incremented in the db, whenever I call it on the subprocess, the value is null. But there are no problems when calling other fields

    4 replies

    stefanhelzle0001
    Brainy
    January 7, 2022

    If the initial insert into DB is done in the node "Write to CRP_Request Entity" then I would like to see screenshots of the data inputs and outputs. Did you check in process monitoring whether the process variables look like expected?

    steffena0001
    January 7, 2022

    Hi Stefan,

    This is the data I/O under the write to request entity.  As for the variables, all values under request were filled correctly except the requestId (PK). 

    requestId=, 

    Input

    Output

    stefanhelzle0001
    Brainy
    January 7, 2022

    OK. This is a very common mistake. The data written to DB is read back and available in the "Stored Values".

    Before you change that, make sure to remove the "Save Into" in the inputs. Using both would lead to a race condition as both assignments want to write to the same process variable.

    Then select your pv!request as target to the "Stored Values".