[Form2] Form name change requires too many changes

Tags: #<Tag:0x00007f751afa0708>

Today when we want to make a change in the name of a form, we do not have any direct way from the UI. It leads to cloning the form with the same structure.

Change in the form leads to following issues:

1.Requires change in Groovy 2.Will act like a complete new form (clone) and the old form will still be present, also causing issues while reporting. 3. Requires change in display control

Suggested solution:

  • Requires change in Groovy
  1. The form can pass to Groovy a list of operations to perform, so that form name is not required by Groovy to determine if we need to run a script on it or not (This will ensure Backward compatibility with existing implementations).
  2. Have a post save js script hook, similar to form conditions to handle this. (For newer implementations)
  • Will act like a complete new form (clone) and the old form will still be present, also causing issues while reporting.
  1. No way to rename a form because we use the form name as key throughout the ecosystem, can we use form uuid instead for the following:
  • Form name and its translations file
  • Obs form namespace path
  1. Have a way to give a new name to a file:
  • Have form name transaltions.

  • Requires change in display control Use the form name, which should not be allowed to change

Note: Today when we have special character in form name we replace it with underscore for the form file name, this is not an extensible solution when all characters in the form name end up being special characters (eg. bengali)

@sriram

Using UUID to identify the form instead of Form Name seems like an good solution. Ideally, the form should be identified by some unique ID and the name should just be another property of the form like the fields in the form. If you are planning to use form UUID instead of form name, you must also provide some way to migrate the existing database entries.

@pramidat yes, we are trying to figure out how we can have backward compatibility will update it here once we have solution(s).

Generally we are thinking to have code supporting both and not migrate existing data, as that might be risky.

Thank you @snehabagri for looking into this.

Would it be possible to map out the suggested options into a high level architecture diagram?

I think we discussed pros and cons of using UUID. “Name” is intuitive in my opinion and “UUID” is not suitable for versions (unless you want to create another model to store the form version histories). UUID must not be only way to do things. You can pass additional information to the groovy script if you want. We also discussed that “OnSave()” method on the form would be preferrable rather to make special provision for Groovy script. Groovy script is a generic approach for “observation” save, and we should not be assuming that “Forms” are the only to save observation (i.e assume form namespace) is always there!