# how I can do a test on an attribute of business variable of list type?

**URL:** <https://community.ofelia.com/t/how-i-can-do-a-test-on-an-attribute-of-business-variable-of-list-type/10527>\
**Category:** Q&A\
**Created:** [9 December 2020 15:06 UTC](https://community.ofelia.com/t/how-i-can-do-a-test-on-an-attribute-of-business-variable-of-list-type/10527 "2020-12-09T15:06:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![maouachria](https://dub1.discourse-cdn.com/flex013/user_avatar/community.ofelia.com/maouachria/32/1237_2.png) [@maouachria](https://community.ofelia.com/u/maouachria)\
**Post date:** [9 December 2020 15:06 UTC](https://community.ofelia.com/t/how-i-can-do-a-test-on-an-attribute-of-business-variable-of-list-type/10527/1 "2020-12-09T15:06:36Z")

</div>

Hi;

On a gateway, I want to do a test on an attribute: observationResultStatus of a business variable of list type: obx.  
Under a transition, I created the following script:  
return  
oru\_R01.patientResult.patientOruR01.patientObservation.obx.forEach (obx.observationResultStatus == 'X').

I get this error:  
Caused by: java.lang.NullPointerException: Cannot get property 'obx' on null object.

where is the problem or how I can do this test ?

---

<div class="post-metadata">

**Author:** ![maouachria](https://dub1.discourse-cdn.com/flex013/user_avatar/community.ofelia.com/maouachria/32/1237_2.png) [@maouachria](https://community.ofelia.com/u/maouachria)\
**Post date:** [10 December 2020 10:37 UTC](https://community.ofelia.com/t/how-i-can-do-a-test-on-an-attribute-of-business-variable-of-list-type/10527/2 "2020-12-10T10:37:52Z")

</div>

I found a solution:&nbsp;

I created a process variable :&nbsp;observationResultStatus&nbsp;as list;

and I added this script:

def n= false;  
observationResultStatus.each {  
&nbsp;&nbsp; &nbsp;if ("${it}"=="X")  
&nbsp;&nbsp; &nbsp;{n= true;}  
}  
return n;
