diff --git a/odatareceptionist/procedures/PrintQueue.xsjslib b/odatareceptionist/procedures/PrintQueue.xsjslib new file mode 100644 index 0000000..d4da330 --- /dev/null +++ b/odatareceptionist/procedures/PrintQueue.xsjslib @@ -0,0 +1,13 @@ +function PrintQueueUpdate(param){ + $.trace.debug('entered function PrintQueueUpdate'); + // let before = param.beforeTableName; + let after = param.afterTableName; + // Update PrintQueue + let pStmt = param.connection.prepareStatement('SELECT * FROM "' + after + '"' ); + let rs = pStmt.executeQuery(); + if (rs.next()) { + var TicketUsed = rs.getNString(4); + } + $.trace.debug('TicketUsed: ' + TicketUsed); + $.trace.debug('leave function PrintQueueUpdate'); +} \ No newline at end of file diff --git a/odatareceptionist/service.xsodata b/odatareceptionist/service.xsodata index c2be72c..e553110 100644 --- a/odatareceptionist/service.xsodata +++ b/odatareceptionist/service.xsodata @@ -49,12 +49,14 @@ service { "com.sap.sapmentors.sitreg.odatareceptionist.procedures::TicketRead" as "Ticket" key ("ParticipantID") create forbidden update using "com.sap.sapmentors.sitreg.odatareceptionist.procedures::TicketUpdate" + events ( after "com.sap.sapmentors.sitreg.odatareceptionist.procedures:PrintQueue.xsjslib::PrintQueueUpdate" ) delete forbidden; association "Event_Ticket" principal "Events"("ID") multiplicity "1" dependent "Ticket"("EventID") multiplicity "*"; association "Participant_Ticket" principal "Participants"("ID") multiplicity "1" dependent "Ticket"("ParticipantID") multiplicity "1"; + // Read PrintQueue "com.sap.sapmentors.sitreg.data::SITreg.PrintQueue" as "PrintQueue" create forbidden