<sml:SendEMails/><ui:setContext ui:queryGraph=\"{= IRI(CONCAT(str(ui:tempGraph), ui:uniqueId())) }\">
<ui:update ui:updateQuery=\"{!
INSERT {
?message a email:Message .
?message email:subject ?subject .
?message email:body ?body .
?message email:from ?from .
?message email:to ?to .
?from email:address ?sender .
?to a email:Address .
?to email:address ?email .
}
WHERE {
BIND (BNODE() AS ?message) .
BIND (BNODE() AS ?from) .
BIND (BNODE() AS ?to) .
BIND (CONCAT("[TopBraid Tasks] Update: ", ?title) AS ?subject) .
BIND (CONCAT(?header, ?text) AS ?body) .
BIND (teamwork:getFromAddress() AS ?fromAddress) .
BIND (COALESCE(?fromAddress, "noreply@example.com") AS ?sender) .
} }\"/>
<sml:SendEMails/>
</ui:setContext>
As a general technique to find examples, look at the EDG implementation itself. For example, open edg.topbraidlive.org/1.0/collection/COLLECTION_EDG-all-...ttl and then select email:Message and Find References. One of them is in teamwork:sendNotifications:
<ui:setContext let:body="{= ?header }{= ?text }{= ?footer }"
ui:queryGraph="{=
IRI(CONCAT(str(ui:tempGraph), ui:uniqueId())) }">
<ui:forEach ui:resultSet="{#
SELECT DISTINCT ?email
WHERE {
( ?property ?projectGraph )
teamwork:partyInGovernanceRoleAtProjectGraph ?party .
?party teamwork:workflowParticipantEmails
?email .
} }">
<ui:update ui:updateQuery="{!
INSERT {
?message a email:Message .
?message email:subject ?title .
?message email:body ?body .
?message email:from ?from .
?message email:to ?to .
?from a email:Address .
?from email:address ?sender .
?to a email:Address .
?to email:address ?email .
}
WHERE {
BIND (BNODE() AS ?message) .
BIND (BNODE() AS ?from) .
BIND (BNODE() AS ?to) .
BIND
(teamwork:singularProjectTypeLabel(teamwork:getProjectType(?projectGraph))
AS ?typeLabel) .
BIND (swa:labelInGraph(?notification,
ui:graph) AS ?rawLabel) .
BIND (CONCAT("[TopBraid]
Notification: ", spif:replaceAll(?rawLabel,
"Vocabulary", ?typeLabel)) AS ?title) .
BIND (teamwork:getFromAddress() AS
?fromAddress) .
BIND (COALESCE(?fromAddress,
"nor...@topquadrant.com") AS ?sender) .
} }"/>
</ui:forEach>
<sml:SendEMails/>
</ui:setContext>
HTH
Holger
--
You received this message because you are subscribed to the Google Groups "TopBraid Suite Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to topbraid-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/a05f58e5-a548-4833-8466-ecef8f56327a%40googlegroups.com.
Hi Sanjeev,
so the update happens to populate a temp graph with the email that shall be sent. For example the variable values for ?body become ?message email:body ?body triples in the temp query graph.
The SELECT DISTINCT loop is just there to iterate over all email
addresses. At the end of the loop, the temp graph contains one
email:Message instance for each workflow participant email. That
technique is the only way to send emails, unless you want to
somehow bypass TopBraid and use your in-house email services
directly (e.g. with a sml:PostRequest).
In your case you can probably build an email from the ui:addedGraph and ui:deletedGraph triples in your EditRule?
Holger
--
You received this message because you are subscribed to the Google Groups "TopBraid Suite Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to topbraid-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/51b6dad3-3047-469e-9c3b-b2264733ba6b%40googlegroups.com.