@fluxhub/fluxhub-lib 19.0.206 → 19.0.209

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -33141,7 +33141,7 @@ class FHWorkflowForm {
33141
33141
  }
33142
33142
  insert_wkf_variabile(p_id_applicativo, p_id_documento, p_var, p_user_idp) {
33143
33143
  let p = new QParam();
33144
- p.sql = 'insert_wkf_variabile';
33144
+ p.sql = 'INSERT_WKF_VARIABILE';
33145
33145
  p.values = [p_id_applicativo, p_id_documento, p_var, p_user_idp];
33146
33146
  this.m_wkf.doQuery(p).subscribe((data) => {
33147
33147
  if (data != null)
@@ -33504,6 +33504,32 @@ class FHWorkflowForm {
33504
33504
  v: this.m_obj.creatore,
33505
33505
  nc: this.m_obj.nc || this.m_obj.creatore,
33506
33506
  });
33507
+ // Oltre a crearla al volo, la persisto sul documento: dai load
33508
+ // successivi arriva gia' da SELECT_WKF_VARIABILES_V2 e il fallback
33509
+ // non serve piu'. La query 'INSERT_WKF_VARIABILE' e' un upsert
33510
+ // (UNIQUE su id_applicativo+uiid+chiave), quindi e' idempotente.
33511
+ this.insert_wkf_variabile(this.id_applicativo, this.id_documento, 'REQUESTER', this.m_obj.creatore);
33512
+ }
33513
+ // Procedi con documento in carico: se lo step corrente usa context
33514
+ // *REQUESTER ma la variabile REQUESTER (gia' presente) punta a un altro
33515
+ // utente, chi sta facendo "procedi" e' comunque l'attore legittimo dello
33516
+ // step. Sostituisco SOLO IN MEMORIA REQUESTER con l'utente corrente, cosi'
33517
+ // non si blocca su [0x002] senza pero' toccare il valore su DB (la
33518
+ // persistenza avviene solo quando la variabile e' ASSENTE, col creatore).
33519
+ // Limitato allo step il cui context e' davvero *REQUESTER.
33520
+ if (this.btnprocedi && this.m_obj) {
33521
+ const currStepUsesRequester = (data.result_data || []).some((v) => Number(v.step) === Number(this.m_obj.stato) &&
33522
+ v.value === '*REQUESTER');
33523
+ if (currStepUsesRequester) {
33524
+ const reqVar = datav.result_data.find((v) => v.k === '*REQUESTER');
33525
+ if (reqVar &&
33526
+ (reqVar.v || '').toUpperCase() !==
33527
+ (this.user_idp || '').toUpperCase()) {
33528
+ reqVar.v = this.user_idp;
33529
+ reqVar.nc =
33530
+ this.app_s.user_surname + ' ' + this.app_s.user_name;
33531
+ }
33532
+ }
33507
33533
  }
33508
33534
  if (this.m_obj.stato == null || this.m_obj.stato <= 10)
33509
33535
  datav.result_data.push({