Table of Contents

FLOW-REQ-001 — Creazione di una richiesta/ticket (Service Desk)

Flusso end-to-end di creazione richiesta (create-or-update → ramo create) del modulo RequestCenter. Path pilota: makeTicket.ascx (creazione interattiva da parte di un operatore Service Desk). Backend Oracle (REQUESTCENTER_TEST38 + cross-schema DEM_TEST38, INFOCAD_TEST38), accesso via stored procedure ODP.NET (nessun ORM).

  • Flow ID: FLOW-REQ-001
  • Repository: InfocadWeb (ASP.NET Web Forms, VB.NET) + RequestCenter BL/DAL
  • Confidence complessiva: VERIFIED (catena codice) · SUPPORTED (mappa proc→tabelle)

Obiettivo di business

Consentire a un operatore Service Desk (o a un chiamante programmatico/portale) di aprire una nuova richiesta (Ticket / Anomalia / Info) associandola a protocollo, oggetto di manutenzione, informazioni spaziali, contatto richiedente, allegati e campi custom, e di avviarne il workflow creando il relativo elemento DEM. Al termine il ticket esiste in stato iniziale, con protocollo assegnato e notifica opzionale inviata.

Attori

  • Operatore Service Desk (utente autenticato, RequestCenterEnabled o super-admin) — path interattivo makeTicket.ascx.
  • Utente portale / self-service — varianti makeWebTicket_*.ascx (NavigationSource=AutoTicket).
  • Sistemi esterni / integrazioni — WCF RequestsReaderWCF.svc / RequestsCacheService.svc (chiamano lo stesso BL Request.Create).
  • Oracle REQUESTCENTER_TEST38 (hub del flusso), DEM_TEST38 (workflow), INFOCAD_TEST38 (anagrafiche/stock, lettura).

Trigger

Submit del form di creazione: evento actSubmt.ActivityRun gestito da btnPost_Click in makeTicket.ascx.vb (postback del pulsante di conferma attività).

Frontend entry point

  • Shell: RequestCenterWeb/Default.aspx (modello shell-page + UserControl caricati dinamicamente).
  • Navigazione: voce di menu "Requests" (idmnuAppData('idworkflow'/'idactivity'/'controlurl')) → JS actioncontroller(0, idWorkflow, idActivity) → caricamento del control makeTicket.ascx.
  • Control: RequestCenterWeb/UserControls/FlowActions/makeTicket.ascx (Inherits="Descor.RequestCenterWeb.makeTicket", code-behind makeTicket.ascx.vb, base class CreateUserControlBase).
  • Gate di accesso: RequestCenterPage.Page_PreInit (redirect a DefaultUrl se non autenticato / non abilitato RequestCenter). WCF gate: ExtraFlowActionsProxy via ValidateLoginKey.

Sequenza principale (main sequence)

  1. Page_Load prepara UI (call type, selettori utente/oggetto/spaziale, alert, allegati, custom fields).
  2. Operatore compila e conferma → btnPost_Click (makeTicket.ascx.vb:82).
  3. Validazione form (DoValidation, ValidateUpload); se errori → bind di errLog e stop.
  4. Se CreationMoment=AfterMakeProtocol(...) genera il protocollo (suffisso per tipo Ticket/Anomaly/Info).
  5. Apertura transazione: New RequestCenter.TransactionOpenConnection()Begin() (:88,111,112).
  6. Insert richiesta: idRequest = RequestCenter.Ticket.Request.Create(iduser, tenantId, protocol, protocolcode, sub, protLevelParent, DateTime.Now) (:114) → BL Request.Create (Request.vb:2222) → dal.addRequestGESTREQUEST_T2.ADDREQUEST (OUT NEWREQUESTINDEX).
  7. Istanzia _objRequest = New Ticket.Request(...) con l'id restituito e imposta i dati: SetSpatialInfo, SetManagement, SetContract, SetCompany, SetExpiry (:120-125); crea oggetti di manutenzione e componenti (RequestMO.Create, RequestComponent.Create, RequestMaintActivity.Create) (:127-137).
  8. _objRequest.WriteDescription() (:185) → dal.setDescriptionGESTREQUEST.ADDDESCRIPTIONTOREQUEST.
  9. SaveCustomFields, SaveFileUpload, SetCallType, SetContactInfo, SetDeferability, SetType, SetFromType (:187-203).
  10. Creazione elemento workflow: newIdElement = _currentAct.Run(iduser) (:210) → DEM.WorkflowCreatingActivity.Run(idactor) (WorkflowActivity.vb:345) → dal.RunCreateDEM.DOCREATEACTIVITY (DEM_TEST38.DEM_DOCREATEACTIVITY).
  11. DEM.ElementMessage.Create(newIdElement, ...) (:211) → messaggio iniziale sull'elemento.
  12. Aggancio WF↔richiesta: _objRequest.SetWorkflowInterface(newIdElement) (:214) → dal.setWorkflowInterfaceGESTREQUEST.ADDWORKFLOWINTERFACE (tab. REQUESTWORKFLOWINTERFACE).
  13. objTransaction.Commit() (:216).
  14. Post-commit: refresh cache (RefreshRC*), eventuale report/file, ProcessAlertSystem() (notifica mail se MailingType<>"none"), log su sessione.
  15. Finally: Ticket.Protocol.DeleteTemporaryProtocol(...) + CloseConnection(); poi RedirectAction(...).

API / service

  • Path interattivo: nessun servizio SOAP/WCF — postback ASP.NET Web Forms diretto.
  • Path programmatico equivalente (stesso BL): RequestsReaderWCF.svc / RequestsCacheService.svc (RequestCenter.Ticket.Request.Create(...)), e WCF ExtraFlowActionsProxy.svc (RunExtraFlowActions) per l'esecuzione di attività su ticket esistenti.

Backend

  • BL: RequestCenter.Ticket.Request (InfocadWeb/WebMachine/RequestCenter/Classes/Request.vb), DEM.WorkflowCreatingActivity (InfocadWeb/WebMachine/DEM/Classes/WorkflowActivity.vb).
  • DAL: RequestCenter.DAL.OracleODPRequestDAL.vb (v4.8, Oracle.DataAccess); net8 riusa gli stessi sorgenti via RequestCenter.DAL.OracleODPXNET (Oracle.ManagedDataAccess.Core). DEM: DEM/DAL.OracleODP/ActivityDAL.vb.
  • Pattern DAL: GlobalDataManagercm.Opencm.ExecuteNonQuery("PKG.PROC", OracleParameter...); identity via parametro OUT (NEWREQUESTINDEX) letto come OracleDecimal.ToInt32.

Query / stored procedure

Passo Stored procedure (Oracle) Chiamata da (DAL)
Insert richiesta REQUESTCENTER_TEST38.GESTREQUEST_T2.ADDREQUEST (OUT NEWREQUESTINDEX) RequestDAL.vb:5078
Insert richiesta (senza protocollo) REQUESTCENTER_TEST38.GESTREQUEST.ADDREQUESTWITHOUTPROTOCOL RequestDAL.vb:5105
Descrizione REQUESTCENTER_TEST38.GESTREQUEST.ADDDESCRIPTIONTOREQUEST RequestDAL.vb:5419
Aggancio interfaccia WF REQUESTCENTER_TEST38.GESTREQUEST.ADDWORKFLOWINTERFACE RequestDAL.vb:5653
Creazione elemento workflow DEM_TEST38.DEM_DOCREATEACTIVITY (via "DEM.DOCREATEACTIVITY") ActivityDAL.vb:247
Load ticket (variante READ-ONLY) REQUESTCENTER_TEST38.GETREQUEST (SELECT via ref-cursor) RequestDAL.vb:31,52

Tabelle lette (read)

  • REQUESTCENTER_TEST38: CALLTYPE, FLOWTYPE, PRICECATEGORY, PRICETYPE, REQUESTINTERVENT, REQUESTLINKED, REQUESTWORKFLOWINTERFACE
  • DEM_TEST38: ELEMENTWORKFLOWSTATE, ACTIVITY
  • INFOCAD_TEST38: STOCK_CATEGORY

(dal catalogo dipendenze dei package GESTREQUEST_T2 e proc DEM_DOCREATEACTIVITY; granularità a livello package body)

Tabelle modificate (write)

  • REQUESTCENTER_TEST38: REQUESTREGISTRY (RW — tabella-radice richiesta, INFERRED), REQUESTREGISTRYDATA (RW), REQUESTCUSTOMLIST (W), REQUESTLINKED (W), REQUESTAPPROVAL (W), REQUESTWORKFLOWINTERFACE (W), REQUESTCHARGE/REQUESTCHARGES (RW), PROTOCOLTEMP (RW, temporaneo protocollo)
  • DEM_TEST38: ELEMENTWORKFLOWSTATE (RW, + sequence ELEMENTWORKFLOWSTATE_0), ELEMENTWORKFLOWHISTORY (W)

Validazione

  • Lato UI: DoValidation() (campi obbligatori del call type), ValidateUpload(uplFilesPanel), UserSelector1.IsRequired / cntSelHL.IsRequired (contatto obbligatorio secondo HeavyLoadMode), spaziale/alert obbligatori per tipo Ticket (ManageTicketMode).
  • Controlli di stato: CheckParentStateChange() / CheckSiblingStateChange() prima del submit (se falliscono → apertura finestra alert, nessuna scrittura).
  • Lato DB: vincoli/sequence nelle procedure GESTREQUEST* (non ispezionati nel dettaglio).

Side effects

  • Assegnazione protocollo definitivo e cancellazione del protocollo temporaneo (PROTOCOLTEMPDeleteTemporaryProtocol).
  • Creazione elemento workflow DEM in stato iniziale (ELEMENTWORKFLOWSTATE/ELEMENTWORKFLOWHISTORY).
  • Salvataggio allegati (filesystem/uplFilesPanel), campi custom.
  • Refresh cache in-memory (WebSharedObject.RequestCenter*, RequestHelper.RefreshRC*).
  • Notifica mail (ProcessAlertSystem) se MailingType<>"none".
  • Eventuale collegamento a richiesta padre (SetLinked) e messaggio su attività padre.

Percorsi alternativi / di errore

  • Errori di validazione → bind di errLog, nessuna transazione aperta.
  • Eccezione durante la transazioneCatch: objTransaction.Rollback(), uplFilesPanel.GoRollBack(), refresh cache, InfocadTraceWrapper.CreateError(...), riabilitazione pulsante submit. Nessun ticket persistito.
  • CreationMoment=Before/After → protocollo generato prima o dopo l'insert (ramo MakeProtocol).
  • Workflow a singola attività (actionWF.WorkflowActivities.Count = 1) → _objRequest.Close() (create-close).
  • Variante senza protocolloRequest.Create(iduser, idtenant, date)GESTREQUEST.ADDREQUESTWITHOUTPROTOCOL (path portale makeWebTicket_*).
  • Variante READ-ONLY (controprova non distruttiva): New RequestWF(usereaders, idRequest, False)RequestDAL.Load/LoadDReaderGETREQUEST (SELECT puro, nessuna scrittura).

Diagramma di sequenza

sequenceDiagram
    actor Op as Operatore SD
    participant UI as makeTicket.ascx (Default.aspx shell)
    participant CB as makeTicket.ascx.vb (btnPost_Click)
    participant BLR as RequestCenter.Ticket.Request
    participant BLA as DEM.WorkflowCreatingActivity
    participant DAL as RequestDAL / ActivityDAL (OracleODP)
    participant RC as Oracle REQUESTCENTER_TEST38
    participant DEM as Oracle DEM_TEST38

    Op->>UI: compila form + conferma (actSubmt.ActivityRun)
    UI->>CB: btnPost_Click
    CB->>CB: DoValidation / ValidateUpload
    CB->>CB: Transaction.Begin()
    CB->>BLR: Request.Create(iduser, tenant, protocol, ...)
    BLR->>DAL: addRequest(...)
    DAL->>RC: GESTREQUEST_T2.ADDREQUEST (OUT NEWREQUESTINDEX)
    RC-->>DAL: idRequest
    DAL-->>CB: idRequest
    CB->>BLR: SetSpatialInfo/Management/Contract/Company/Expiry, RequestMO/Component
    CB->>BLR: WriteDescription()
    BLR->>DAL: setDescription(...)
    DAL->>RC: GESTREQUEST.ADDDESCRIPTIONTOREQUEST
    CB->>BLA: _currentAct.Run(iduser)
    BLA->>DAL: RunCreate(idworkflow, idactivity, idactor)
    DAL->>DEM: DEM_DOCREATEACTIVITY -> ELEMENTWORKFLOWSTATE / HISTORY
    DEM-->>CB: newIdElement
    CB->>BLR: SetWorkflowInterface(newIdElement)
    BLR->>DAL: setWorkflowInterface(...)
    DAL->>RC: GESTREQUEST.ADDWORKFLOWINTERFACE (REQUESTWORKFLOWINTERFACE)
    CB->>CB: Transaction.Commit()
    CB->>CB: ProcessAlertSystem (mail) + refresh cache
    CB-->>Op: RedirectAction (ticket creato)

Matrice di tracciabilità

Layer Artefatto Evidenza (file:riga)
UI makeTicket.ascx (control) .../RequestCenterWeb/UserControls/FlowActions/makeTicket.ascx:1
Code-behind btnPost_Click (Handles actSubmt.ActivityRun) makeTicket.ascx.vb:82
Base class CreateUserControlBase (_currentAct As DEM.WorkflowCreatingActivity) CreateUserControlBase.vb:26
BL Request.Createdal.addRequest Request.vb:2222-2224
BL WriteDescriptiondal.setDescription Request.vb:2342-2346
BL SetWorkflowInterfacedal.setWorkflowInterface Request.vb:2596-2600
BL (DEM) WorkflowCreatingActivity.Rundal.RunCreate WorkflowActivity.vb:345-349
DAL addRequestGESTREQUEST_T2.ADDREQUEST RequestDAL.vb:5054,5078
DAL setDescriptionGESTREQUEST.ADDDESCRIPTIONTOREQUEST RequestDAL.vb:5407,5419
DAL setWorkflowInterfaceGESTREQUEST.ADDWORKFLOWINTERFACE RequestDAL.vb:5641,5653
DAL (DEM) RunCreateDEM.DOCREATEACTIVITY ActivityDAL.vb:232,247
DAL (read) Load/LoadDReaderGETREQUEST RequestDAL.vb:31,52
DB GESTREQUEST_T2 writes REQUESTREGISTRY, ... stored-procedure-dependencies.csv
DB DEM_DOCREATEACTIVITY writes ELEMENTWORKFLOWSTATE/HISTORY stored-procedure-dependencies.csv

Reverse trace (dal BL ai chiamanti)

grep "Request.Create(" conferma che lo stesso entry point BL è condiviso da: UI interattiva (makeTicket.ascx.vb:114), portale (makeWebTicket_OVR/OMSimple_*), WCF integrazioni (RequestsReaderWCF.svc.vb:590,808,991, RequestsCacheService.svc.vb:526), helper server-side (RequestHelper.vb:1308,1529). Forward e reverse concordano → NO CONFLICTING.

  • Momento di creazione del protocollo (Parametric.RequestCenter.Protocol.GetCreationMoment: Before/After) e suffisso per tipo call.
  • HeavyLoadMode: alterna selettore utente vs contatto obbligatorio.
  • Workflow a singola attività ⇒ create-close automatico.
  • Abilitazione notifiche: RequestCenter.Configuration.Settings.MailingType.

Evidenza (file:line)

Vedere docs/_evidence/FLOW-REQ-001/report.md per la tabella completa (C1-C19 + reverse + DB). Punti chiave: makeTicket.ascx.vb:82,114,185,210,214; Request.vb:2222,2342,2596; RequestDAL.vb:5078,5419,5653,31,52; WorkflowActivity.vb:345; ActivityDAL.vb:247; stored-procedure-dependencies.csv (GESTREQUEST_T2 / GESTREQUEST / DEM_DOCREATEACTIVITY).

Confidence

  • VERIFIED: catena UI → code-behind → BL → DAL → nome stored procedure (letta sul sorgente).
  • SUPPORTED: mappa stored-procedure → tabelle (catalogo dipendenze, granularità package body).
  • INFERRED: REQUESTREGISTRY come tabella insert primaria della richiesta.

Open questions

  • Isolare le tabelle scritte dalla sola GESTREQUEST_T2.ADDREQUEST (il catalogo aggrega a livello di package body).
  • Tabelle DEM coinvolte da ElementMessage.Create (messaggio iniziale) non ancora mappate.
  • Mapping IIS della virtual directory RequestCenterWeb sotto la shell Cassandra (runtime).
  • Comportamento in configurazioni PROD (visto solo config TEST38).