xtk.workflow.postEvent in adobe campaign classic | Community
Skip to main content
vaidehig2773360
Level 2
August 30, 2018
Solved

xtk.workflow.postEvent in adobe campaign classic

  • August 30, 2018
  • 12 replies
  • 12326 views

Hi

I am calling TestBatchfileExt  from TestWorkflow

vars.listName="GOLD FISH";

logInfo("Calling workflow: TestBatchFileExt");

xtk.workflow.PostEvent("TestBatchFileExt", "signal", "", <variables varName= {vars.listName} />, false);

logInfo("Called successfully");

logInfo("ListNameFromSource" + vars.listName);

How can I access vars.listName in estBatchfileExt.

Please post your answer

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by vraghav

Hi vaidehig27733606,

On the TestBatchFileExt place a JS code activity and read the variable

var myListName = vars.listName;

logInfo("Name passed from calling workflow : " + myListName);

Regards,
Vipul

12 replies

vraghav
Adobe Employee
vraghavAdobe EmployeeAccepted solution
Adobe Employee
August 31, 2018

Hi vaidehig27733606,

On the TestBatchFileExt place a JS code activity and read the variable

var myListName = vars.listName;

logInfo("Name passed from calling workflow : " + myListName);

Regards,
Vipul

vaidehig2773360
Level 2
August 31, 2018

Thanks for your quick reply

I am able access the parameters in the destination workflow.

vaidehig2773360
Level 2
August 31, 2018

Hi Vipul

I have another question

When we use External signal to call Technical workflow from campaign workflow ,can we pass variable(parameter) from campaign workflow to technical workflow.

Please give your answer,it would be great help for me.

Thanks

vraghav
Adobe Employee
Adobe Employee
September 3, 2018

Sure we should be able to do so.

vaidehig2773360
Level 2
September 4, 2018

Hi Vipul

Thanks for your reply for previous questions.I need another help for the below sceanrio

Here is my sceanrio

Campaign workflow:

Will contain 3 activities

  1. 1. First activity trigger the technical workflow by passing the subscription list name which needs to be refreshed (enriched)
  2. 2. Second activity which needs to keep checking the record count before and after the enrichment

Until both counts are equal, then only we can execute third  activity in the campaign workflow

How to achieve this in campaign workflow, the second activity should keep checking the record count until both are equal

  1. 3. third activity is Approval activity which will send email to the business by saying that enrichment is completed

Technical workflow:

Technical workflow will prepare the records for the enrichment through batch process and then batch process will enrich the records and update the count (take time to update the count table)

Please give your inputs and thoughts,that would be great.

Thanks

Vaidehi

vraghav
Adobe Employee
Adobe Employee
September 5, 2018

Hi Vaidehi,

You can use vars.recCount before enriching to store in an instance variable

then after enrichment you can use a test activiyt and check current vars.recCount = instance.vars.recCount

vaidehig2773360
Level 2
September 6, 2018

Hi Vipul

Thanks for your reply

We are planning to store both  the counts before and after enrichment in the table

so in that case campaign workflow activity is going to query the table check the count if both are equal,   one workflow update the before_count, another workflow will update after_count, when it will get updated, we never know.it may take 15 min or 1 or 2 hrs.

in that scenario, which activity will be suitable to query the table continuously until the counts are available and both are equal

will JavaScript code do the job ? can we put the query and checking conditions inside the

while(true){

          Select before_count,after_count from count_table

          where campaignId=campId;

          if(before_count == after_count)

               exit;

}

is that good approach?, Please give your inputs and thoughts

Thanks

Vaidehi

vraghav
Adobe Employee
Adobe Employee
September 7, 2018

Hi Vaidehi,

Apologies but I'm not getting the full picture of the requirement here.

Can we start a new thread with clear explanation on the requriement.

Regards,
Vipul

vaidehig2773360
Level 2
September 7, 2018

Hi Vipul

I really appreciate your reply,I agree with you, I will be back with my explanation.

Thanks

Vaidehi

vaidehig2773360
Level 2
September 11, 2018

Hi Vipul

Test activity which has the following variable from temp table

beforeRefreshCount = 39 (long data type in the table)

and afterRefreshCount = 0(long data type in the table)

39 == 0 returns true,

How should I compare two long values in Test Activity

the condition vars.beforeRefreshCount === vars.afterRefreshCount is returning true always

Why it is not comparing correctly, please give your answer, that would be great help for me.

below is the script to get the values from temp table and passing beforeRefreshCount and afterRefreshCount to Test Activity

var campId=vars.campaignIdentifier;

var beforeRefreshCount;
var afterRefreshCount;
var refreshStatus;

var query = xtk.queryDef.create(
    <queryDef schema="temp:RefreshCounts" operation="select">
      <select>
        <node expr="@id"/>
        <node expr="@campaignIdentifier" />
        <node expr="@fileRecCount" />
        <node expr="@incrementalCount" />
        <node expr="@loadingStatus" />
      </select>
      <where>
           <condition expr= {"@campaignIdentifier= '" + campId + "'"} />
      </where>
      
    </queryDef>);

    var res = query.ExecuteQuery();
   
    for each (var row in res){
   
    logInfo("Id value is  =" + row.@campaignIdentifier);
    beforeRefreshCount= row.@fileRecCount;
    afterRefreshCount=row.@incrementalCount;
    refreshStatus = row.@loadingStatus;
   
    }
   
    logInfo("Before Refreshment" + beforeRefreshCount);
    logInfo("AfterRefreshment" + afterRefreshCount);
   
   
    //vars.beforeRefreshCount = beforeRefreshCount;
    //vars.afterRefreshCount = afterRefreshCount;
   
    logInfo(beforeRefreshCount === afterRefreshCount)