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
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Personalizing error notification using values from operation schema

mpalaves
Level 1
Level 1

Hello Team,

 

 

Is it possible to set values from campaign to the variables in a workflow notification template.

 

I am trying to generate a notification to workflow supervisor with campaign name when a campaign workflow fails.

 

Thank you.

 

1 Reply
Manoj_Kumar_
Community Advisor
Community Advisor

Hello @mpalaves 

 

You can get the campaign name in workflow with this code.

 

 var q = xtk.queryDef.create(
  <queryDef schema="xtk:workflow" operation="get">
    <select>
      <node expr="[operation/@label]" alias="@label/>    
    </select>
    <where>     
        <condition expr={"@id ="+instance.id}  /> 
    </where>
      
  </queryDef>
);
var workflow= q.ExecuteQuery();
logInfo("Operation Name is :"+workflow.@label);
mpalaves
Level 1
Level 1

Thank you @Manoj_Kumar_  for your reply.

I am able to get the campaign name but unable to pass it to the workflow error notification template. How can I pass this extracted value to the workflow notification that is sent to the supervisors when the workflow fails.

 

Regards,

Manoj_Kumar_
Community Advisor
Community Advisor

@mpalaves 

 

after this code Add this line.

 

instance.vars.campaignName=workflow.@label

Then open the delivery and in advance tab for delivery add this code.

 

delivery.variables._var[0].stringValue=instance.vars.campaignName;

Now open the delivery go to properties and under variables tab. Create a new variable with data type as string and name it campaignName;

 

Now in your delivery HTML you can use this code to print the campaign Name

<%= variables.campaignName %>

 

mpalaves
Level 1
Level 1

Hello @Manoj_Kumar_ 

 

Excuse me if my request was not clear. I am still learning the tool. I am referring to use the value in a error notification template. I do not have a delivery task in the workflow to notify the workflow supervisors. 

 

I have customized the technical delivery template with the campaign name variable. But unable to assign the value to it.

 

mpalaves_0-1633109671254.png

 

denisb91363072
Employee
Employee

HI There,

 

Unless I am mistaken on the request but the Alert activity allows you to get the Workflow and Campaign information via the editor itself. See below

denisb91363072_0-1633618427352.png

Hope this helps,

Thanks

Denis

kapilKochar
Community Advisor
Community Advisor

Hi, 

When you use supervisor notification as alert there is a link at the end which have all the details of that workflow which failed because of some error and also contains Campaign link and campaign label . If you check the source in HTML , it's using workflow.jssp 

 

<%@ include option='NmsServer_IntranetURL' %>/xtk/workflow.jssp?id=<%= dataSource.workflowId %>

 

kapilKochar_0-1634641844044.png

 

kapilKochar_1-1634641932560.png