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
BedrockMission!

Learn More

View all

Sign in to view all badges

Extract error log from workflow log table using querydef

Avatar

Avatar
Validate 1
Level 1
hemantsharma
Level 1

Likes

2 likes

Total Posts

3 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 1
hemantsharma
Level 1

Likes

2 likes

Total Posts

3 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
hemantsharma
Level 1

19-02-2018

Hi Team

I am trying to extract error code & message  from workflow log table for a particular wf using querydef but getting error.

JS code

1422371_pastedImage_0.png

error:

1422373_pastedImage_2.png

1422376_pastedImage_5.png

Please suggest some solution

Thanks in advance!!

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Validate 1
MVP
Jean-Serge_Biro
MVP

Likes

352 likes

Total Posts

464 posts

Correct Reply

153 solutions
Top badges earned
Validate 1
Boost 50
Boost 5
Boost 3
Boost 250
View profile

Avatar
Validate 1
MVP
Jean-Serge_Biro
MVP

Likes

352 likes

Total Posts

464 posts

Correct Reply

153 solutions
Top badges earned
Validate 1
Boost 50
Boost 5
Boost 3
Boost 250
View profile
Jean-Serge_Biro
MVP

19-02-2018

Hi hemantsharma,

The minus sign, in workflow-id name identifier, generates the error, due to Javascript syntax restriction.

So, you need to use the escaping syntax [@workflow-id] instead.
And please use the {}, it is better.

<where>
  <node expr={[@workflow-id] = 123456789} />
</where>

Regards

Jean-Serge

Answers (2)

Answers (2)

Avatar

Avatar
Validate 1
MVP
Jean-Serge_Biro
MVP

Likes

352 likes

Total Posts

464 posts

Correct Reply

153 solutions
Top badges earned
Validate 1
Boost 50
Boost 5
Boost 3
Boost 250
View profile

Avatar
Validate 1
MVP
Jean-Serge_Biro
MVP

Likes

352 likes

Total Posts

464 posts

Correct Reply

153 solutions
Top badges earned
Validate 1
Boost 50
Boost 5
Boost 3
Boost 250
View profile
Jean-Serge_Biro
MVP

20-02-2018

Hi hemantsharma,

Please see below the limit parameter, and the order clause.

var param = '[@workflow-id] = 123456789';

var query = xtk.queryDef.create(

  <queryDef schema="xtk:workflowLog" operation="select" limit="30">

    <select>

      <node expr="@error"/>

      <node expr="[@workflow-id]"/>

    </select>

    <where>

      <node expr={param} />

    </where>

    <orderBy>

     <node expr="[@workflow-id]" sortDesc="true"/>

    </orderBy>   

  </queryDef>

);

By the way, might you declare as correct answer the post to complete this ticket (green status)?
Many thanks in advance.

Regards
JS

Avatar

Avatar
Validate 1
Level 1
hemantsharma
Level 1

Likes

2 likes

Total Posts

3 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 1
hemantsharma
Level 1

Likes

2 likes

Total Posts

3 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
hemantsharma
Level 1

19-02-2018

Thanks Jean ,it worked but I am getting all error log ,my requirement is to get only latest error can you suggest some filtering condition

I am trying to use max(logdate) or max(@id) conditions but dont know syntax how to impelement, if there is any other way please suggest.