diff --git a/agent/scripts/fm_xml_to_snippet.py b/agent/scripts/fm_xml_to_snippet.py index b91d8327..bfc44e4a 100644 --- a/agent/scripts/fm_xml_to_snippet.py +++ b/agent/scripts/fm_xml_to_snippet.py @@ -339,6 +339,9 @@ def tx_show_custom_dialog(step) -> str: title_calc = '' message_calc = '' buttons = [] # list of (label_str, commit_state_str) + # input_fields[i] = {'use_password': str, 'kind': 'field'|'variable'|'empty', + # 'table': str, 'id': str, 'name': str, 'var': str, 'label': str} + input_fields = {1: None, 2: None, 3: None} for p in all_params(step): ptype = p.get('type', '') @@ -353,6 +356,40 @@ def tx_show_custom_dialog(step) -> str: if b is not None: commit = b.get('value', 'False') buttons.append((label, commit)) + elif ptype in ('Field1', 'Field2', 'Field3'): + slot = int(ptype[-1]) + entry = { + 'use_password': 'False', + 'kind': 'empty', + 'table': '', + 'id': '0', + 'name': '', + 'var': '', + 'label': '', + } + # Password flag + for b in p.findall('Boolean'): + if b.get('type', '') == 'Password': + entry['use_password'] = b.get('value', 'False') + # Target (field or variable) + for sub in p.findall('Parameter'): + if sub.get('type', '') == 'Target': + var_el = sub.find('Variable') + if var_el is not None: + entry['kind'] = 'variable' + entry['var'] = var_el.get('value', '') + continue + fr = sub.find('FieldReference') + if fr is not None: + entry['kind'] = 'field' + entry['id'] = fr.get('id', '0') + entry['name'] = fr.get('name', '') + tor = fr.find('TableOccurrenceReference') + if tor is not None: + entry['table'] = tor.get('name', '') + elif sub.get('type', '') == 'Label': + entry['label'] = get_calc_text(sub) + input_fields[slot] = entry parts = [ f'{S}', @@ -375,7 +412,42 @@ def tx_show_custom_dialog(step) -> str: ] else: parts.append(f'{L2} +