I want to store the current process id in an external database 

how do I get the process id in the beanshell form binder?

  • No labels

6 Comments

  1. Hi Vishal,

    You may use the Assignment hash variable as described in Hash Variables. Hope this helps.

    Thanks.

  2. Thanks Hugo,

    I want to set the current processid in 

    the following coding that i have put in the beanshell

    FormRow originalRow = rows.get(0);

    FormRowSet newRows = new FormRowSet();

    FormRow newRow = new FormRow();

    String id=#assignment.processId#;

    newRow.put("processid", id);

    newRows.add(newRow);

    return rows;

    But it is giving me Error...

    Above coding is not working .

    Where I am going Wrong please tell me?

    or any other method to get process id?

    1. String id=#assignment.processId#;

      Hey Vishal,

      I guess you forgot to quote your string?

      Cheers~

      1. Thanks Hugo,

        I have tried the following ways in my above coding
        But still it is not working..

        String id=#assignment.processId#;String id="#assignment.processId#";String id=assignment.processId;
        Any other ways to get processid in beanshell...

        1. You need to quote the hash variable!

          "#assignment.processId#"

          1. Dear Hugo,

            I have a similar problem. Reading the hash variable works in the BeanShell form load binder but not in the form store binder. I'm using the same way to access the hash variable in both.

            For the form load binder the output of system.out.println is

            ========================

            168_ressourcePlanning_ressourcePlanningMain

            ========================

            For the form store binder the output of system.out.println is

            ========================

            #assignment.processId#

            ========================

            Is there any difference in accessing hash variables from a form load binder and a form store binder?

            Kind Regards

            Hubert