コミュニティアチーブメントバーを展開する。

Submissions are now open for the 2026 Adobe Experience Maker Awards
解決済み

Ab test workflow to test 4 subject lines in one workflow

Avatar

Level 4

@Parvesh_Parmar ,@AkshayAnand 

,@isahore ,@AndreaBriceno,@ParthaSarathy

,@ParthaS ,@Craig_Thonis ,@Manoj_Kumar_ ,@Amine_Abedour ,@Marcel_Szimonisz,@DavidKangni 

,@Amit_Kumar,@ShashankNigam02,@Ganesh5067, @Jonathon_wodnicki

@Amine_Abedour 

 

hi all

i need to create ab test workflow to test 4subject lines in one workflow

 

also when i am runnjng out of box script given in

aodbe doc

its failing ..any one have ab test Js script code 

which support 4segment in a wkf

also please share insights what and how can we modify the oob script to make this work for 4segments

 

 

 

トピック

トピックはコミュニティのコンテンツの分類に役立ち、関連コンテンツを発見する可能性を広げます。

1 受け入れられたソリューション

Avatar

正解者
Community Advisor

Hi @DishaSharma,

 

Can you share details as to what error you are seeing and what code have you written?

The standard js code that evaluates the winner delivery based on the configured criteria should work fine for handling any number of variants.

 

 // query the database to find the winner (here - best click rate)
   var winner = xtk.queryDef.create(
     <queryDef schema="nms:delivery" operation="get">
       <select>
         <node expr="@id"/>
         <node expr="@label"/>
         <node expr="[@operation-id]"/>
         <node expr="[@workflow-id]"/>
       </select>
       <where>
         <condition expr={"@FCP=0 and [@workflow-id]= " + instance.id}/>
       </where>
       <orderBy>
         <node expr="[indicators/@totalRecipientClickRatio]" sortDesc="true"/>
       </orderBy>
     </queryDef>).ExecuteQuery()

   // create a new delivery object and initialize it by doing a copy of
   // the winner delivery
   var delivery = nms.delivery.create()
   delivery.Duplicate("nms:delivery|" + winner.@id)

   // append 'final' to the delivery label
   delivery.label = winner.@label + " final"

   // link the delivery to the operation to make sure it will be displayed in
   // the campaign dashboard.
   delivery.operation_id = winner.@["operation-id"]
   delivery.workflow_id = winner.@["workflow-id"]

   // adjust some delivery parameters to make it compatible with the
   // "Prepare and start" option selected in the Delivery tab of this activity
   delivery.scheduling.validationMode = "manual"
   delivery.scheduling.delayed = 0

   // save the delivery in database
   delivery.save()

   // store the new delivery Id in event variables
   vars.deliveryId = delivery.id

BR,

Ishan

 

BR,

Ishan

元の投稿で解決策を見る

1 返信

Avatar

正解者
Community Advisor

Hi @DishaSharma,

 

Can you share details as to what error you are seeing and what code have you written?

The standard js code that evaluates the winner delivery based on the configured criteria should work fine for handling any number of variants.

 

 // query the database to find the winner (here - best click rate)
   var winner = xtk.queryDef.create(
     <queryDef schema="nms:delivery" operation="get">
       <select>
         <node expr="@id"/>
         <node expr="@label"/>
         <node expr="[@operation-id]"/>
         <node expr="[@workflow-id]"/>
       </select>
       <where>
         <condition expr={"@FCP=0 and [@workflow-id]= " + instance.id}/>
       </where>
       <orderBy>
         <node expr="[indicators/@totalRecipientClickRatio]" sortDesc="true"/>
       </orderBy>
     </queryDef>).ExecuteQuery()

   // create a new delivery object and initialize it by doing a copy of
   // the winner delivery
   var delivery = nms.delivery.create()
   delivery.Duplicate("nms:delivery|" + winner.@id)

   // append 'final' to the delivery label
   delivery.label = winner.@label + " final"

   // link the delivery to the operation to make sure it will be displayed in
   // the campaign dashboard.
   delivery.operation_id = winner.@["operation-id"]
   delivery.workflow_id = winner.@["workflow-id"]

   // adjust some delivery parameters to make it compatible with the
   // "Prepare and start" option selected in the Delivery tab of this activity
   delivery.scheduling.validationMode = "manual"
   delivery.scheduling.delayed = 0

   // save the delivery in database
   delivery.save()

   // store the new delivery Id in event variables
   vars.deliveryId = delivery.id

BR,

Ishan

 

BR,

Ishan