Expand my Community achievements bar.

SOLVED

Getting the name of delivery used in continous delivery activity before sending an email

Avatar

Level 4

Hi Team, 

 

i have a requirement where i need dto get the name of the delivery used in continous delivery component before it's execution :  like the image below in the javascript node i want the label of the delivery template which is used in continous delivery. Can anyone suggest 

 

Ramaswami_0-1590659602362.png

 

 

here is what i see when i query my workflow for deliveries and xml data : 

 

Ramaswami_0-1590684927404.png

 

hi kapil, 

 

Below are the results i am seeing when i use query def : 

i have two continous delivery components inside my workflow : 

 

Ramaswami_0-1590755160367.png

 

Ramaswami_1-1590755191239.png

 

i need this name inside the continous delivery : 

Ramaswami_2-1590755226767.png

 

 

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi ,

 

If you check the workflow XML all continuous delivery saved between <notification> Tag. Inside Notification tag there is one field name as "scenario-cs" . This field saves the label of the delivery template which that continuous delivery contains. 

 

So what you need to do is : 

 

xmldata is [queryDef of xtk:workflow]

var activityXML = xmldata.workflow.activities.notification;

for each (var child in activityXML)
{
logInfo("Retrieve fields value ->"+child.@label)
}

View solution in original post

8 Replies

Avatar

Community Advisor

Hello @Ramaswami ,

Use can query the workflow schema via javascript and then pull the deliveries attached to that workflow to get the name/label for the delivery.


     Manoj
     Find me on LinkedIn

Avatar

Level 4
hi @ManojK, i have tried that but i am getting blank when pull the data. you can see in my screenshot attached in my question.

Avatar

Correct answer by
Community Advisor

Hi ,

 

If you check the workflow XML all continuous delivery saved between <notification> Tag. Inside Notification tag there is one field name as "scenario-cs" . This field saves the label of the delivery template which that continuous delivery contains. 

 

So what you need to do is : 

 

xmldata is [queryDef of xtk:workflow]

var activityXML = xmldata.workflow.activities.notification;

for each (var child in activityXML)
{
logInfo("Retrieve fields value ->"+child.@label)
}

Avatar

Level 4
Hi @Mvp, What i need to pull from queryDef, if you want me to pull the xml memo(data) i am seeing blank in xml memo column when i just wanted to test it by query activity. You can see my screenshot in my question.

Avatar

Community Advisor
Hi Ramaswami, Any column you can fetch just to get the workflow XML.

Avatar

Community Advisor
var query = xtk.queryDef.create( <queryDef schema="xtk:workflow" operation="select"> <select> <node expr="@internalName"/> <node expr="data" label="XML Memo"/> </select> <where> <condition expr="[@id]='7271'"/> </where> </queryDef>); var xmldata = query.ExecuteQuery(); var activityXML = xmldata.workflow.activities.notification; for each (var child in activityXML) { logInfo("Continous delivery Label ->"+child.@label) }

Avatar

Level 4
Hi @kapil, I have used your query def and the results which are printing are the label of continous delivery component ( not the label of delivery template inside the contionus delivery component ). Please see my screenshot in the question and thanks for the code.

Avatar

Community Advisor
Hi @Ramaswami, You need to use scenario-cs column for template label. As mentioned above. I gave you example of label column, just replace it with scenario-cs column.