Exception in Gosu script editor: Cannot traverse in window mode

2,301 views
Skip to first unread message

Mirza Daniyal Ahmad

unread,
Oct 21, 2016, 10:02:23 AM10/21/16
to gosu-lang
I am fairly new to Gosu scripting and am getting this below exception on in Gosu script editor while trying to print an entity:

var period = Query.make(entity.PolicyPeriod).compare("PublicID", Equals, "somePublicID").select().FirstResult
print(period)
if(period.Buildings_CG == null) ///**********************This line is failing *******************//
{
  print("period.Buildings_CG is null ?")
}

Exception:
java.lang.IllegalArgumentException: Cannot traverse in window mode

Any idea what may be wrong here?

vijay vellala

unread,
Oct 21, 2016, 10:20:09 AM10/21/16
to gosu...@googlegroups.com
PolicyPeriod comes in two modes - Window mode and Slice mode.
var period = Query.make(entity.PolicyPeriod).compare("PublicID", Equals, "somePublicID").select().FirstResult
period = period.getSlice(period.EditEffectiveDate)
if(period.Buildings_CG == null) ///**********************This line is failing *******************//
{
  print("period.Buildings_CG is null ?")
}

This is a feature of Guidewire where data can be changed as of some effective date. This means that there can be multiple versions of the job. When you try to look into the Period most of the times it will be in a Slice mode. You can also view data across all the versions and this is called Window mode. The above Query gave you a object in Window mode and you need to look at the building's properties that are available as of some date(this will be a Slice).



--
You received this message because you are subscribed to the Google Groups "gosu-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gosu-lang+unsubscribe@googlegroups.com.
To post to this group, send email to gosu...@googlegroups.com.
Visit this group at https://groups.google.com/group/gosu-lang.
For more options, visit https://groups.google.com/d/optout.



--
V.Vijay Krishna Vatsalya

Mirza Daniyal Ahmad

unread,
Oct 21, 2016, 10:30:25 AM10/21/16
to gosu-lang
Been asking around in office but couldn't have been explained better than you did. It all makes sense now
Thanks a lot !

vijay vellala

unread,
Oct 21, 2016, 10:31:45 AM10/21/16
to gosu...@googlegroups.com

You are welcome. Have a good day!


--

paunet

unread,
Nov 21, 2016, 9:19:05 PM11/21/16
to gosu-lang


On Friday, October 21, 2016 at 10:02:23 AM UTC-4, Mirza Daniyal Ahmad wrote:
I am fairly new to Gosu scripting and am getting this below exception on in Gosu script editor while trying to print an entity:

var period = Query.make(entity.PolicyPeriod).compare("PublicID", Equals, "somePublicID").select().FirstResult
print(period)
if(period.Buildings_CG == null) ///**********************This line is failing *******************//
{
  print("period.Buildings_CG is null ?")
}


Hi,

Curious but what if EditEffectiveDate is the overall value you are using to access the PolicyPeriod and you really don't need the slice?

Regards,
Paul

sridhar kumar Ch

unread,
Dec 1, 2016, 1:33:38 AM12/1/16
to gosu...@googlegroups.com
Hi Paul,

For your question here is the detailed answer.

This can happen at multiple points in the Guidewire application. It has been seen in both configuration and integration code. All objects in PolicyCenter can either be in slice or window mode. 

Slice - Contains the version of the object at a specific point in time, such as the effective date of the job. This is the mode that most people interact with.

Window - Contains the data for all the versions of the object for the life of the policy term.

There are many functions in the system that assumes we are running in slice mode. Each of these functions will throw the Illegal Argument Exception. To fix this, we need to find the PolicyPeriod. This may be in the current method or we may need to look in calling functions or traverse the entity model. We can then use the getSlice(date) method to get the slice that is effective on a specific date. In most cases, we will use the effective date for the current job.

Hope it clarifies for your question.

Thanks,
Sridhar Chinchili


--
You received this message because you are subscribed to the Google Groups "gosu-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gosu-lang+unsubscribe@googlegroups.com.
To post to this group, send email to gosu...@googlegroups.com.
Visit this group at https://groups.google.com/group/gosu-lang.
For more options, visit https://groups.google.com/d/optout.



--


Thanks,
Sridhar Chinchili




Reply all
Reply to author
Forward
0 new messages