How to add a process variable in already initiated process instance and map this new process variable to a form input.

Hi All,

I have a encountered an issue where a process instance on production environment is launched on previous process model,as the process was still in progress when we did our new patch release. The scenario is that in one of our user input task we have added a new mandatory field and as the process initiated on previous version of process model does not have process variable to capture this new field and our form is stuck due to this. Can you please provide your inputs what will be best solution to handle this problem ? Can we use IFIM or Process upgrade service to achieve the requisite condition? Please provide your valuable inputs for this.

  Discussion posts and replies are publicly visible

  • Hi Shangloos,

    When you open a process instance in monitor process view you have an option to add process variable. After adding process variable you can configure that value to your user input task in edit process view mode. if you have multiple instances open, For this approach, you need to modify all the instances individually.

    Hope this will work for you..

    Thank You,
  • 0
    Certified Lead Developer
    Also if you want to add process variables for large number of processes you can use IFM smart service
  • As Naresh said you can create process variable in the instance. But I suggest you to modify the process model itself and run the instance again, if you can. If you cannot terminate the current instance, you can do as naresh said.
    Thanks,
    Yeswanth.
  • 0
    Certified Lead Developer
    You cannot add new process variables to a process instance. You can override existing variables with new values, but cannot create new ones. I would suggest to restart the entire process once it has been updated to the new version.
  • 0
    Certified Lead Developer
    Yes, We can create a variable in the running instance and can map this newly created variable into their respective node in edit mode.

    You can follow below mention steps to do so:

    1. Monitor an ongoing process instance >> Click on Properties >> Click on Add Variable >> Define the properties for the newly created variable such as Variable Name, Type etc..

    2. Now, edit this process instance and you can find this newly created variable available in edit process mode, and you will be able to map this variable into the various nodes such as Script Task, User Input Task, Gateways etc...

    Note: Cancelling an ongoing instance (Specially in production environment) is not the best approach, because if this process has critical business logic implemented including DB operation, then this might impact the business, also the number of instances can be huge.

    Also, when we talk about the Patch deployment, it's always a best practice to handle inflight instances(by doing the null check, or some other approach) instead of modifying them one after another, as you aware if number of instances are huge then it will be a difficult job to modify these many instances either manually or by using IFM Smart Service.

    Hope this helps.
  • 0
    Certified Senior Developer

    Hi all,

    Does anyone have any additional information about this issue?  I also a requirement to add a new variable to new and inflight instances of a process.  This process is used in a process backed record, so we need to display this new value in a record grid.  I added the new variable to the process model and I used the IFM Manager smart services to insert and update the variables in inflight processes.  IFM worked like a charm, but the updated values are not showing on a process report, nor showing up on the frontend in my record grid for inflight processes.  The new variable is displaying just fine on newly created process instances.  Any suggestions or explanations would be appreciated.

    Thanks