1
1

Hi All,

We are trying to detect expired tasks by implementing IWorkflowListener. We have same way to detect newly created task, every thing is working fine with create task listener but we are facing environment not available with expired task listener (both listeners are accessing the Ivy environment).

We detects newly created task by checking status WorkflowEventKind.EVENT_CREATE_TASK_BY_JOINED_TASKS and expired task is WorkflowEventKind.EVENT_CHANGE_TASK_TIMEOUT_TIMESTAMP.

My questions are:

What is the different of those states (WorkflowEventKind) when it's fired? Is there any way to access Ivy environment outside request? for example ivy global variable?

Thanks, Lam Nguyen

asked 22.01.2018 at 05:12

Lam%20Nguyen's gravatar image

Lam Nguyen
(suspended)
accept rate: 0%

edited 22.01.2018 at 05:18


Hi Lam

The availability of Ivy environment variable Inside a workflow listener depends on the thread that drives the notification. The Event CREATE_TASK_BY_JOINED_TASK is normally send by a request thread that just ended a task and therefore a new task is created. The Event CHANGE_TASK_TIMEOUT_TIMESTAMP is normally send by a background job that is expring tasks.

In the request thread the environment is available but not in the background job.

To access a global variable from a non request thread is complex because you have to setup a correct context first. And there is also no helper API to do that provided by Axon.ivy.

Regards

Reto Weiss, Axon.ivy Support

link

answered 22.01.2018 at 08:21

Reto%20Weiss's gravatar image

Reto Weiss ♦♦
4.9k202857
accept rate: 74%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×4

Asked: 22.01.2018 at 05:12

Seen: 1,276 times

Last updated: 23.01.2018 at 12:05