We have a certain situation where the current named user shall be logged out and be logged in as a different user. The problem is, that this results in an illegal task state. Code in the script step:

ivy.session.loginSessionUser("user1", "user1");

if(in.isSuperior == true) {
    ivy.session.loginSessionUser("superiorUser", "superiorUser");
    }

Exception:

Exception at element [13B4B87B3A16CFA4-f15-io0]: java.lang.IllegalStateException: State of Task must be one of the following values CREATED, RESUMED but is ZOMBIE:

Is there a way to avoid this behavoir?

Xpert.ivy 4.3. - error occurs on Designer & Server level.

asked 15.05.2014 at 11:30

Nikel%20Weis's gravatar image

Nikel Weis
(suspended)
accept rate: 57%


If you login a session user all tasks that were resumed by the session are reset. This also includes the current task that executes the script step with the login statements. To avoid this use the overloaded method that takes an additional third parameter an provide it the identifier of the current task.

E.g.

ivy.session.loginSessionUser("user1", "password1", ivy.task.getId());

In this case all tasks that were resumed by the session are reset except the one with the given id.

link

answered 15.05.2014 at 17:41

Reto%20Weiss's gravatar image

Reto Weiss ♦♦
4.9k202857
accept rate: 74%

edited 16.05.2014 at 08:30

Thanks. The API was not quite clear on the effect of this parameter. Works like a charm.

(16.05.2014 at 08:58) Nikel Weis Nikel%20Weis's gravatar image
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:

×26

Asked: 15.05.2014 at 11:30

Seen: 2,563 times

Last updated: 16.05.2014 at 08:58