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

AC classic - query on activies of workflow

Avatar

Level 2

Hi All,

 

I would like to perform some queries on workflows. For example i want to take all wokflow which have a query with a specific label, or delivery with specific parameter and so on.

 

Under the workflow fields list i see all the possible activies with all the relevant field (see picture below)

federico___0-1647431751058.png

But when i try to make a query on a specific activity (e.g. Javascript code exist such as....) under the activity i don't find any field (see picture below).

federico___1-1647431879542.png

 

Do you know if i can perform somehow this type of query?

 

Thank you

1 Accepted Solution

Avatar

Correct answer by
Level 4

Hi @federico__,

You cannot run such a query on workflows in a workflow query activity since these data are not stored as SQL fields, but in the xml of the workflows.

So for this you need to run a xtk:queryDef query inside a javascript activity. There you can select all your workflows, and then parse the xml of each workflow to check if they contain a query activity with a given label, or a delivery with a given label, etc.

 

Thanks,

Ishan

View solution in original post

5 Replies

Avatar

Employee Advisor

Hi Federico,

 

You may be able to extend the workflow schema and create a specific field that notes individual workflow activities contained in a workflow. That said, as I have not seen this implemented before, I cannot tell you how exactly to do this or if there will be any significant performance impact.

 

Regards,

Craig

Avatar

Level 2

Hello Craig,

Thank you for the answer.

Unfortunately i cannot change the db schema creating a new table because i don't have the permission.

Anyway do you know why i cannot perform this query as always? 

 

If i change the query (e.g. check only if javascript activity exist), i get the following error

federico___0-1647437767982.png

 

Regards,

 

Avatar

Correct answer by
Level 4

Hi @federico__,

You cannot run such a query on workflows in a workflow query activity since these data are not stored as SQL fields, but in the xml of the workflows.

So for this you need to run a xtk:queryDef query inside a javascript activity. There you can select all your workflows, and then parse the xml of each workflow to check if they contain a query activity with a given label, or a delivery with a given label, etc.

 

Thanks,

Ishan

Avatar

Level 2

Super Thanks! It worked!!

Do you know if also temporary tables (e.g. tables generated during workflow execution) are stored as xml and not as sql? 

Avatar

Level 4

Hi @federico__ ,

Tables generated during workflow execution are stored as sql tables. You can get their name between activities by using the vars.tableName variable.

 

Thanks,

Ishan