Expand my Community achievements bar.

Join us for the Adobe Campaign Community Q&A Coffee Break on 30th September at 8 am PT with Campaign experts Arthur Lacroix and Sandra Hausmann.
SOLVED

What are the variables of an instance?

Avatar

Level 5

In the documentation, I see:

The instance variables (instance.vars.xxx) are comparable to global variables. They are shared by all activities.

What are the options for the XXX part? A user is using /@hora .. but  I don't see hora as a column of xtk:workflow. That XXX part should be only one of the columns of xtk:workflow, right?

SubMinutes( GetDate() , $(instance/vars/@hora) * 30) // Removing the And condition fixes the workflow.

ogonzalesdiaz_0-1721926620637.png


Also, according to documentation, in oder to use it you have to define it first in an JS activity, and the 

ogonzalesdiaz_1-1721926847695.png

But the query activity doesn't have anything defined and the JS "Data" activity,,, doesn't define anything.

ogonzalesdiaz_2-1721926906383.png

 


The error log is:

07/25/2024 11:49:56 AM b0-42d7-8ff1-b55cfdeb4fcf') AND (P0.tsCreated = SubMinutes(GetDate() , '' * 30))) AND ((P0.iPipelineEventId > 0 OR P0.iPipelineEventId < 0))' could not be executed.
07/25/2024 11:49:56 AM WDB-200001 SQL statement 'INSERT INTO wkf94388735_81019_1 (mData,sCodinternocomputacionalhash,sRUBRO,tsCreated,iId) SELECT DISTINCT P0.mData, NULL, NULL, P0.tsCreated, P0.iPipelineEventId FROM AcxPipelineEvent P0 WHERE ((P0.sTriggerType = E'a80c22d9-97
07/25/2024 11:49:56 AM PGS-220000 PostgreSQL error: ERROR: invalid input syntax for type integer: "" LINE 1: ...4fcf') AND (P0.tsCreated = SubMinutes(GetDate() , '' * 30)))... ^ .


Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @ogonzalesdiaz,

 

The xxx part in instance.vars.xxx isn't at all a collumn of xtk:workflow.

You should declare it before using it on the workflow.

Exemple of declaring it on a js code activity : 

Amine_Abedour_0-1721988528823.png

 

After executing the workflow you can see the variables on the Properties on the workflow here  : 

Amine_Abedour_1-1721988796257.png

 

To use the variables in other activities of the workflow, please check this documentation Variables

Br,

 

 

View solution in original post

4 Replies

Avatar

Level 5

I don't even see DeliveryIN as a column of xtk:workflow

Avatar

Level 4

Hi @ogonzalesdiaz 

I am pretty sure you wont be able to see the instance variables as part of the columns as such. They sort of exist in the global context of the workflow execution. It is also correct that the instance variables should be defined somewhere in the workflow. 

The error looks like either a typing error where the name of the variable is incorrect or a data type error. Would be helpful to see the expression where the variable is used as well as where it is defined in the workflow  

For reference, here is a image example of how to use it: 

SorenDP_0-1721980430554.png

 

SorenDP_1-1721980469211.png

 



Avatar

Correct answer by
Community Advisor

Hi @ogonzalesdiaz,

 

The xxx part in instance.vars.xxx isn't at all a collumn of xtk:workflow.

You should declare it before using it on the workflow.

Exemple of declaring it on a js code activity : 

Amine_Abedour_0-1721988528823.png

 

After executing the workflow you can see the variables on the Properties on the workflow here  : 

Amine_Abedour_1-1721988796257.png

 

To use the variables in other activities of the workflow, please check this documentation Variables

Br,

 

 

Avatar

Level 5

Hi @Amine_Abedour Thank you. 

So, would you say event variables (vars.xxx) and instance variables (instance.vars.xxx) should be place in an JS activity?

While Taks events inside the activity from where you want to use it? So Task events should be place in the Advance tab of a Query activity or...

ogonzalesdiaz_0-1721996601279.png
...in "Properties > Variables" of a delivery?

ogonzalesdiaz_1-1721996711043.png