Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

How to Personalize the Workflow content into Alert Activity.

ramprakasht3196
Level 3
Level 3

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.

1838776_pastedImage_0.png

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.

1 Accepted Solution
Jean-Serge_Biro
Correct answer by
Community Advisor
Community Advisor

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

View solution in original post

4 Replies
wesp27904446
Level 2
Level 2

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:

Help: Adding work table content into a workflow alert

Jean-Serge_Biro
Correct answer by
Community Advisor
Community Advisor

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

View solution in original post

Jean-Serge_Biro
Community Advisor
Community Advisor

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