"Notifications" in the Spark / BPM UI Toolkit are the client-side messages a coach shows to the user - not the e-mail task notifications of the portal. Mechanisms, and how they work:
- Control-level validation messages: control.setValid(false, "message") marks the control (red border) and shows the text under it; setValid(true) clears it. Used by the coach validation framework: errors added with tw.system.coachValidation.addValidationError(path, msg) are routed to the controls bound to path.
- Status Box / Alert controls: in-page messages with a color style; set text and show / hide from code (question 2441).
- Modal Alert: a blocking dialog (${Dialog}.setText("..."), .show()), and Modal Section for dialogs with content; both are Bootstrap modals under the hood.
- Toast-style notifications: the toolkit has no toast control; the common pattern is an Alert with auto hide placed in a fixed-position layout, or a tiny custom view wrapping a Bootstrap alert with a timeout.
- Service errors: the Service Call / Data controls raise On error with {errorCode, errorText}; you decide where to show it.
// helper used by every button of a coach: show a message for 4 seconds
function notify(style, text) {
var a = ${Notice}; a.setColorStyle(style); a.setText(text); a.setVisible(true);
clearTimeout(window._noticeTimer); window._noticeTimer = setTimeout(function () { a.setVisible(false); }, 4000);
}
notify("S", "Draft saved");Server-side "notifications" (task assigned, due, comments) are a different feature: Process Portal's notification settings and the task e-mail templates; the Workplace on BAW 20+ / CP4BA shows those as in-app notifications from the server.
References