Hi,
I am trying to add the outbound transition content into alert activity for personalization. The image of workflow i added below. The alert activity is not populating the workflow content to the notification mails. In notification mail it sending only the text content present in alert activity not the content coming from previous activity. Below is the code iam using javascript activity as well alert actvity.
javascript activity code:
var query =xtk.queryDef.create (
<queryDef schema= "temp:query32" operation="select">
<select>
<node expr="@internalName"/>
<node expr="@lastStart" />
<node expr="@fullName" />
<node expr="@name" />
</select>
</queryDef>)
instance.vars.items = query.ExecuteQuery();
Alert Activity code:
<%
var items = new XML(instance.vars.items)
for each (var item in items){
%>
<%= item.target.@fullName %>
<%= item.target.@internalName %>
<%= item.target.@lastStart %>
<%= item.target.@name %>
<%
} %>
Please help me to solve this issue. Thanks in advance.
Regards,
Ram.
Solved! Go to Solution.
Hello Ram & Wesp,
Please have a look on factory ACC workflows using Alert activities, such as:
stockMgt
You will see how to pass the variables from Javascript part to Html part of the Alert activity (the same if the Javascript is done in a prior Javascript activity), it is a question of XML management for storage and reading in instance or event vars.
So in your case, do the same:
Javascript part:
var query = xtk.queryDef.create (
<queryDef schema= "temp:query" operation="select">
<select>
<node expr="@internalName"/>
<node expr="@lastStart" />
</select>
</queryDef>)
var itemsXML = query.ExecuteQuery();
vars.itemsXMLString = itemsXML.toXMLString()
HTML source part (with no format/presentation effort ):
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
</HEAD>
<BODY>
<P><%= vars.recCount %></P>
<P>
<br/>
Workflows List Start:
<br/>
<%
var itemsXML = new XML(vars.itemsXMLString)
for each (var item in itemsXML){
%>
<%= item.@internalName %>
<%= item.@lastStart %>
<br/>
<%
} %>
<br/>
Workflows List End.
</P></BODY></HTML>
Regards
J-Serge
I've been having this same issue and have not yet figured it out. Below is my previous post with a limited response...maybe you can figure this out from context where i could not:
Hello Ram & Wesp,
Please have a look on factory ACC workflows using Alert activities, such as:
stockMgt
You will see how to pass the variables from Javascript part to Html part of the Alert activity (the same if the Javascript is done in a prior Javascript activity), it is a question of XML management for storage and reading in instance or event vars.
So in your case, do the same:
Javascript part:
var query = xtk.queryDef.create (
<queryDef schema= "temp:query" operation="select">
<select>
<node expr="@internalName"/>
<node expr="@lastStart" />
</select>
</queryDef>)
var itemsXML = query.ExecuteQuery();
vars.itemsXMLString = itemsXML.toXMLString()
HTML source part (with no format/presentation effort ):
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
</HEAD>
<BODY>
<P><%= vars.recCount %></P>
<P>
<br/>
Workflows List Start:
<br/>
<%
var itemsXML = new XML(vars.itemsXMLString)
for each (var item in itemsXML){
%>
<%= item.@internalName %>
<%= item.@lastStart %>
<br/>
<%
} %>
<br/>
Workflows List End.
</P></BODY></HTML>
Regards
J-Serge
Thank you so much for sharing this. It was something that we have been looking to do as well. Could this be modified to only return distinct records in the final alert? For example, we are including the project name in the alert. Some records will have the same project name and we only want to show that once in the email.
Views
Replies
Total Likes
One more thing:
Don't forget the other less clean solution, when the Javascript code is small like Ramprakasht's demand, you can put all the queryDef code inside the HTML source tab, so no XMLString() to do.
Well I do it sometimes, but I know, it is better to separate business logic and HTML format/presentation.
Regards
J-Serge
This worked perfectly. Thank you!
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies