Bean attribute not present in session object

Posted by Harrie Kuijper on 19-May-2015 02:20

Hi all,

I have a question about getting the bean object from the session in OE BPM. The code I use to get the bean is:

session.getAttribute("bean");

According to this article of the knowledgebase, that's correct: http://knowledgebase.progress.com/articles/Article/P173990

But it always returns null. Does someone know a possible cause, or how to solve this?

Regards,

Harrie.

All Replies

Posted by Jawahar Surapaneni on 19-May-2015 02:45

Hi Harrie,

Can you confirm how exactly are you trying this usecase...

Is this using a Form? or Using a CustomJSP?

Regards,

Jawahar.

Posted by Harrie Kuijper on 19-May-2015 02:54

It's a custom JSP file.

Posted by Jawahar Surapaneni on 19-May-2015 03:55

OK.

Can you please confirm, the following tags exists in your .jsp file

<jsp:useBean id="bizManage" class="com.savvion.sbm.bizmanage.api.BizManageBean" scope="session"></jsp:useBean>

  <jsp:useBean id="bean" class="com.savvion.BizSolo.beans.Bean" scope="session"></jsp:useBean>

  <jsp:useBean id="factoryBean" class="com.savvion.BizSolo.beans.EPFactoryBean" scope="session"></jsp:useBean>

  <jsp:useBean id="bizSite" class="com.savvion.sbm.bpmportal.bizsite.api.BizSiteBean" scope="session"></jsp:useBean>

Regards,

Jawahar

Posted by Harrie Kuijper on 19-May-2015 04:35

Hi Jawahar,

I added the lines, but now it returns an object with an empty dataslots map. Which is expected behaviour if bean is null while using useBean. (useBean instantiates an empty bean if the session attribute is null)

Do you have  another suggestion?

Regards,

Harrie.

Posted by Jawahar Surapaneni on 19-May-2015 06:15

Hi Harrie,
You can give a try in the following way
 
1. Create an Actvity
2. Add necessary dataslots to it and save the activity
3. Change the presentation type to Custom JSP
 
From here, i guess you should be able to access the dataslot value.
 
Regards,
Jawahar.
 
[collapse]
From: Harrie Kuijper [mailto:bounce-hkuijper@community.progress.com]
Sent: 19 May 2015 15:06
To: TU.BPM@community.progress.com
Subject: RE: [Technical Users - BPM] Bean attribute not present in session object
 
Reply by Harrie Kuijper

Hi Jawahar,

I added the lines, but now it returns an object with an empty dataslots map. Which is expected behaviour if bean is null while using useBean. (useBean instantiates an empty bean if the session attribute is null)

Do you have  another suggestion?

Regards,

Harrie.

Stop receiving emails on this subject.

Flag this post as spam/abuse.

[/collapse]

Posted by Harrie Kuijper on 23-Jun-2015 06:59

Hi Jawahar,

Thanks for your answer. But that is not really the use case. I was maybe unclear with the custom JSP page. The JSP page is not attached to a activity. But is an independent JSP page within my BPM project.  It is included using an iframe in the process' user interface.

Is there a way to get this bean in this context?

Regards,

Harrie.

Posted by Jawahar Surapaneni on 24-Jun-2015 01:48

Hi Harries,
You can achieve this in two ways
 
1. If you are not using an iFrame, the Custom JSP page can be accessed by specifying the following tag
 
<%@include file="MyCustom.jsp" %>
 
This is the recommended way.
 
2. Or, if you want to access  from an Iframe, please specify the following attributes in your external jsp page
 
<jsp:useBean id="bizManage" class="com.savvion.sbm.bizmanage.api.BizManageBean" scope="session"></jsp:useBean>
  <jsp:useBean id="bean" class="com.savvion.BizSolo.beans.Bean" scope="session"></jsp:useBean>
  <jsp:useBean id="factoryBean" class="com.savvion.BizSolo.beans.EPFactoryBean" scope="session"></jsp:useBean>
  <jsp:useBean id="bizSite" class="com.savvion.sbm.bpmportal.bizsite.api.BizSiteBean" scope="session"></jsp:useBean>
 
And then in the activity jsp page, use the following tags
 
<iframe src="MyCustom.jsp"></iframe>
 
Regards,
Jawahar.
 
[collapse]
From: Harrie Kuijper [mailto:bounce-hkuijper@community.progress.com]
Sent: 23 June 2015 17:30
To: TU.BPM@community.progress.com
Subject: RE: [Technical Users - BPM] Bean attribute not present in session object
 
Reply by Harrie Kuijper

Hi Jawahar,

Thanks for your answer. But that is not really the use case. I was maybe unclear with the custom JSP page. The JSP page is not attached to a activity. But is an independent JSP page within my BPM project.  It is included using an iframe in the process' user interface.

Is there a way to get this bean in this context?

Regards,

Harrie.

Stop receiving emails on this subject.

Flag this post as spam/abuse.

[/collapse]

Posted by Harrie Kuijper on 24-Jun-2015 02:23

Hi Jahawar,

I already did that, like you suggested at May 19th too. There are no dataslots filled inside the bean. If I print all elements of bean.getDataSlots() with this code:

Map dataSlotMap = bean.getDataSlots();
System.out.println("==== START CONTENT DATASLOT MAP ====");
for(Object key : dataSlotMap.keySet()) {
System.out.println(key + ": " + dataSlotMap.get(key));
}
System.out.println("==== END CONTENT DATASLOT MAP ====");

The result is:

09:02:06,359 INFO [STDOUT] ==== START CONTENT DATASLOT MAP ====
09:02:06,360 INFO [STDOUT] ==== END CONTENT DATASLOT MAP ====

So, clearly no elements inside it. The workstep which this JSP is included in has definitely dataslots attached.

Regards,

Harrie.

Posted by skothuri on 24-Jun-2015 08:03

Hi Harrie,
 
In order to work with <iframe> within the custom JSPs, please append the “fiid” as a URL parameter to the “src” attribute.
Example: <iframe src="Your_Custom_Jsp.jsp?fiid=<%=request.getParameter(BizSoloRequest.BSS_FIID)%>"></iframe>
 
However, the recommended way of including JSP inside JSP is to use the “include” or “jsp:include” directives.
 
Thank you,
Srinivas Kothuri.
 
[collapse]
From: Harrie Kuijper [mailto:bounce-hkuijper@community.progress.com]
Sent: Wednesday, June 24, 2015 12:54 PM
To: TU.BPM@community.progress.com
Subject: RE: [Technical Users - BPM] Bean attribute not present in session object
 
Reply by Harrie Kuijper

Hi Jahawar,

I already did that, like you suggested at May 19th too. There are no dataslots filled inside the bean. If I print all elements of bean.getDataSlots() with this code:

Map dataSlotMap = bean.getDataSlots();
System.out.println("==== START CONTENT DATASLOT MAP ====");
for(Object key : dataSlotMap.keySet()) {
System.out.println(key + ": " + dataSlotMap.get(key));
}
System.out.println("==== END CONTENT DATASLOT MAP ====");

The result is:

09:02:06,359 INFO [STDOUT] ==== START CONTENT DATASLOT MAP ====
09:02:06,360 INFO [STDOUT] ==== END CONTENT DATASLOT MAP ====

So, clearly no elements inside it. The workstep which this JSP is included in has definitely dataslots attached.

Regards,

Harrie.

Stop receiving emails on this subject.

Flag this post as spam/abuse.

[/collapse]

Posted by Harrie Kuijper on 24-Jun-2015 08:25

I am not using the custom jsp IN a custom jsp. I'm using the custom jsp in a form which is generated by the form designer. So using that code is not possible for me. Since it is impossible to use hottags (<%=%>) in the properties pane. So we used javascript to kinda "hack" the src attribute. That's a js file, where we cannot use the jsp hottags.

This thread is closed