{"ref":"content:sap-cloud-application-programming-model-cap-part-2","page":"/content/sap-cloud-application-programming-model-cap-part-2","json":"/content/sap-cloud-application-programming-model-cap-part-2.json","generated":"2026-10-26","drafted_with_ai":true,"entity":{"id":"sap-cloud-application-programming-model-cap-part-2","title":"SAP Cloud Application Programming Model（CAP）：カスタムロジックの実装 – Part 2","url":"https://community.sap.com/t5/technology-blog-posts-by-sap/sap-cloud-application-programming-model-cap-%E3%82%AB%E3%82%B9%E3%82%BF%E3%83%A0%E3%83%AD%E3%82%B8%E3%83%83%E3%82%AF%E3%81%AE%E5%AE%9F%E8%A3%85-part-2/ba-p/13486233","content_type":"blog","published_on":"source:sap-community","explains":[{"ref":"capability:error-handling","applies_to":{"ecosystems":["cap"]}},"capability:transaction-management"],"part_of":"content:sap-cloud-application-programming-model-cap-part-1","position":2,"summary":"A walkthrough of implementing custom logic in a CAP Node.js service for the [capire bookshop](artifact:capire-bookshop) sample, registering before, on and after handlers around the generated CRUD service for its Books and Orders entities. The before handler validates an incoming order's amount and runs a transactional CQN UPDATE to decrement stock, raising a 400 or 409 through req.error when the amount is invalid or no rows match; an after handler on READ appends a discount note to overstocked books.","short":"Before, on and after handlers in a CAP bookshop, in Japanese","author":"rasai","published":"2021-01-01","provenance":{"discovered_via":[{"source":"source:sap-community","channel":"cap-tag"}],"first_seen":"2026-10-10"},"drafted_with_ai":true},"readings":{"liveness":[{"label":"Checked against the source","tier":"unknown","evidence":"nobody has checked it"},{"label":"Source reachable","tier":"unknown","evidence":"not crawled"},{"label":"Age","tier":"poor","evidence":"published 69 months ago"}],"compatibility":[{"label":"Version","tier":"unknown","evidence":"no version declared"},{"label":"Moved since?","tier":"good","evidence":"no recorded change after 2021-01-01"},{"label":"Findings","tier":"good","evidence":"none flagged"}],"reach":[{"value":2629,"unit":"views"},{"value":1,"unit":"comments"},{"value":9,"unit":"likes"}]},"signals":{"views":2629,"likes":9,"comments":1,"metrics_at":"2026-10-25"},"series":{"container":false,"of":2,"at":2,"parts":[{"position":1,"title":"SAP Cloud Application Programming Model（CAP）：概要およびデモ - Part 1","url":"https://community.sap.com/t5/technology-blog-posts-by-sap/sap-cloud-application-programming-model-cap-%E6%A6%82%E8%A6%81%E3%81%8A%E3%82%88%E3%81%B3%E3%83%87%E3%83%A2-part-1/ba-p/13485597","published":"2020-12-31","state":"indexed","id":"sap-cloud-application-programming-model-cap-part-1"},{"position":2,"title":"SAP Cloud Application Programming Model（CAP）：カスタムロジックの実装 – Part 2","url":"https://community.sap.com/t5/technology-blog-posts-by-sap/sap-cloud-application-programming-model-cap-%E3%82%AB%E3%82%B9%E3%82%BF%E3%83%A0%E3%83%AD%E3%82%B8%E3%83%83%E3%82%AF%E3%81%AE%E5%AE%9F%E8%A3%85-part-2/ba-p/13486233","published":"2021-01-01","state":"indexed","id":"sap-cloud-application-programming-model-cap-part-2"}]},"edges":{"authors":[]}}