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-schemaDEM_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,
RequestCenterEnabledo super-admin) — path interattivomakeTicket.ascx. - Utente portale / self-service — varianti
makeWebTicket_*.ascx(NavigationSource=AutoTicket). - Sistemi esterni / integrazioni — WCF
RequestsReaderWCF.svc/RequestsCacheService.svc(chiamano lo stesso BLRequest.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" (
idmnu→AppData('idworkflow'/'idactivity'/'controlurl')) → JSactioncontroller(0, idWorkflow, idActivity)→ caricamento del controlmakeTicket.ascx. - Control:
RequestCenterWeb/UserControls/FlowActions/makeTicket.ascx(Inherits="Descor.RequestCenterWeb.makeTicket", code-behindmakeTicket.ascx.vb, base classCreateUserControlBase). - Gate di accesso:
RequestCenterPage.Page_PreInit(redirect aDefaultUrlse non autenticato / non abilitato RequestCenter). WCF gate:ExtraFlowActionsProxyviaValidateLoginKey.
Sequenza principale (main sequence)
Page_Loadprepara UI (call type, selettori utente/oggetto/spaziale, alert, allegati, custom fields).- Operatore compila e conferma →
btnPost_Click(makeTicket.ascx.vb:82). - Validazione form (
DoValidation,ValidateUpload); se errori → bind dierrLoge stop. - Se
CreationMoment=After→MakeProtocol(...)genera il protocollo (suffisso per tipo Ticket/Anomaly/Info). - Apertura transazione:
New RequestCenter.Transaction→OpenConnection()→Begin()(:88,111,112). - Insert richiesta:
idRequest = RequestCenter.Ticket.Request.Create(iduser, tenantId, protocol, protocolcode, sub, protLevelParent, DateTime.Now)(:114) → BLRequest.Create(Request.vb:2222) →dal.addRequest→GESTREQUEST_T2.ADDREQUEST(OUTNEWREQUESTINDEX). - 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). _objRequest.WriteDescription()(:185) →dal.setDescription→GESTREQUEST.ADDDESCRIPTIONTOREQUEST.SaveCustomFields,SaveFileUpload,SetCallType,SetContactInfo,SetDeferability,SetType,SetFromType(:187-203).- Creazione elemento workflow:
newIdElement = _currentAct.Run(iduser)(:210) →DEM.WorkflowCreatingActivity.Run(idactor)(WorkflowActivity.vb:345) →dal.RunCreate→DEM.DOCREATEACTIVITY(DEM_TEST38.DEM_DOCREATEACTIVITY). DEM.ElementMessage.Create(newIdElement, ...)(:211) → messaggio iniziale sull'elemento.- Aggancio WF↔richiesta:
_objRequest.SetWorkflowInterface(newIdElement)(:214) →dal.setWorkflowInterface→GESTREQUEST.ADDWORKFLOWINTERFACE(tab.REQUESTWORKFLOWINTERFACE). objTransaction.Commit()(:216).- Post-commit: refresh cache (
RefreshRC*), eventuale report/file,ProcessAlertSystem()(notifica mail seMailingType<>"none"), log su sessione. Finally:Ticket.Protocol.DeleteTemporaryProtocol(...)+CloseConnection(); poiRedirectAction(...).
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 WCFExtraFlowActionsProxy.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.OracleODP—RequestDAL.vb(v4.8,Oracle.DataAccess); net8 riusa gli stessi sorgenti viaRequestCenter.DAL.OracleODPXNET(Oracle.ManagedDataAccess.Core). DEM:DEM/DAL.OracleODP/ActivityDAL.vb. - Pattern DAL:
GlobalDataManager→cm.Open→cm.ExecuteNonQuery("PKG.PROC", OracleParameter...); identity via parametro OUT (NEWREQUESTINDEX) letto comeOracleDecimal.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,REQUESTWORKFLOWINTERFACEDEM_TEST38:ELEMENTWORKFLOWSTATE,ACTIVITYINFOCAD_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, + sequenceELEMENTWORKFLOWSTATE_0),ELEMENTWORKFLOWHISTORY(W)
Validazione
- Lato UI:
DoValidation()(campi obbligatori del call type),ValidateUpload(uplFilesPanel),UserSelector1.IsRequired/cntSelHL.IsRequired(contatto obbligatorio secondoHeavyLoadMode), 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 (
PROTOCOLTEMP→DeleteTemporaryProtocol). - 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) seMailingType<>"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 transazione →
Catch: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 protocollo →
Request.Create(iduser, idtenant, date)→GESTREQUEST.ADDREQUESTWITHOUTPROTOCOL(path portalemakeWebTicket_*). - Variante READ-ONLY (controprova non distruttiva):
New RequestWF(usereaders, idRequest, False)→RequestDAL.Load/LoadDReader→GETREQUEST(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.Create → dal.addRequest |
Request.vb:2222-2224 |
| BL | WriteDescription → dal.setDescription |
Request.vb:2342-2346 |
| BL | SetWorkflowInterface → dal.setWorkflowInterface |
Request.vb:2596-2600 |
| BL (DEM) | WorkflowCreatingActivity.Run → dal.RunCreate |
WorkflowActivity.vb:345-349 |
| DAL | addRequest → GESTREQUEST_T2.ADDREQUEST |
RequestDAL.vb:5054,5078 |
| DAL | setDescription → GESTREQUEST.ADDDESCRIPTIONTOREQUEST |
RequestDAL.vb:5407,5419 |
| DAL | setWorkflowInterface → GESTREQUEST.ADDWORKFLOWINTERFACE |
RequestDAL.vb:5641,5653 |
| DAL (DEM) | RunCreate → DEM.DOCREATEACTIVITY |
ActivityDAL.vb:232,247 |
| DAL (read) | Load/LoadDReader → GETREQUEST |
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.
Regole correlate (related rules)
- 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:
REQUESTREGISTRYcome 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
RequestCenterWebsotto la shell Cassandra (runtime). - Comportamento in configurazioni PROD (visto solo config TEST38).