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

SOLVED

Update Delivery logs

Avatar

Level 4

Hi all,

I have something rare with some deliveries, for example this delivery :

1775316_pastedImage_0.png

The emails to send is 16, but processed number is 20 and succes is 19, which is completely wrong, after getting inside the delivery log i notice that the number of processed should be 16 and succes should be 15 :

1775317_pastedImage_1.png

But, after i do a recompute of the delivery, using the "recompute all from the elementary tracking logs":

1775319_pastedImage_3.png

1775320_pastedImage_4.png

the datas come back to normal.

my question here is if there is a way to update those datas, using a workflow that get executed automatically everyday for example?

Thanks,

Badr.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi,

You can write a workflow that collects recent delivery id's and runs them through js function nms.delivery.RecomputeStats(id, 15).

Note this is very expensive db-wise.

Thanks,

-Jon

View solution in original post

4 Replies

Avatar

Correct answer by
Community Advisor

Hi,

You can write a workflow that collects recent delivery id's and runs them through js function nms.delivery.RecomputeStats(id, 15).

Note this is very expensive db-wise.

Thanks,

-Jon

Avatar

Level 4

Hi Jon and thank you for your answer,

Yeah that code worked for me, i will explain how i did it in case if someone needs :

i did a query before, taking just the deliveries with processed percentage more than 100.

then a javascript code like this:

var schemaName = vars.targetSchema.substr(vars.targetSchema.indexOf(":") + 1); 

 

var query = xtk.queryDef.create( 

  <queryDef schema={vars.targetSchema} operation="select"> 

    <select> 

      <node expr="@id"/> 

    </select> 

  </queryDef> 

); 

result = query.ExecuteQuery(); 

 

for each (var e in result) { 

 

logInfo(e.@id);

nms.delivery.RecomputeStats(e.@id, 15)

 

 

Jon (or adobe campaign forum member) if you can explain me 2 things: 

1- what the dirtyflags means, i didnt understand that well from the documentation :

dirtyFlags

Bit field describing what to recompute (see the 'nms:delivery:dirtyFlags' enumeration).

2- the number 15, why ?

Thanks,

Badr

Avatar

Community Advisor

Hi,

It's documented in the nms:delivery:dirtyFlags enumeration, under the nms:delivery schema.

15 is just adding all the numbers up (set all flags/bits in the integer).

Thanks,

-Jon

Avatar

Community Advisor

Hello,

There's no need of hardcoding the value "15", you can use JS bitwise operators (Bitwise operators - JavaScript | MDN ) as follow:

var nmsDeliveryDirtyFlags_tracking = 1; // tracking logs

var nmsDeliveryDirtyFlags_messageCounters = 8; // broad logs

var flags = nmsDeliveryDirtyFlags_tracking | nmsDeliveryDirtyFlags_messageCounters; // bit operation

NLWS.nmsDelivery.RecomputeStats(vars.deliveryId, flags);

Kind regards

Florian