[JBoss Seam] - can't access non-Seam variables from jPDL decision condition
by shea.phillips
Hello,
After significant amount of troubleshooting, I have discovered that the org.jboss.seam.jbpm.SeamVariableResolver is used when resolving variables in a expression inside jBPM jPDL when the process is started inside of Seam.
This is fine and very useful in many cases, however, in my scenario, I am doing the following:
- starting the process from Seam with a single BUSINESS_PROCESS scope String var
- invoking Seam components from embedded jPDL scripts, which set process context variables (non-Seam), that are subsequently referenced in condition expressions
- the condition expression evaluation uses the SeamVariableResolver and, as a result does not see the variable I exposed from my script, although other scripts do (apparently they use some different variable resolution strategy)
Here is my jPDL snippet:
| <node name="establishInterpretationProcess">
| <transition to="decideOnInterpretation">
| <script>
| <expression>
| import org.jboss.seam.Component;
| import com.foo.ECGInterpretationProcessNameResolverService;
|
| System.out.println("ECG ID is '" + ecgId + "'");
|
| lookup = Component.getInstance(ECGInterpretationProcessNameResolverService.NAME, true);
|
| interpretationName = lookup.determineInterpretationProcessName(ecgId);
|
| System.out.println("Interpretation name in establishInterpretationProcess is '" + interpretationName + "'");
| </expression>
| <variable name="ecgId" mapped-name="ecgId" access="read"/>
| <variable name="interpretationName" mapped-name="interpretationName" access="read,write"/>
| </script>
| </transition>
| </node>
|
| <decision name="decideOnInterpretation">
| <transition name="interpret" to="doInterpretation"/>
| <transition name="dontInterpret" to="assignForManualInterpretation">
| <condition>#{interpretationName == null}</condition>
| <script>System.out.println("interpretationName was null!");</script>
| </transition>
| </decision>
|
The specific behaviour here is that the expression #{interpretationName == null} always evaluates to null, so the associated transition is always taken, regardless of the value of the interpretationName process context variable (as set in the script)
I tried to outject a value with BUSINESS_PROCESS scope from my component invoked in the script, but this also was not visible by the expression.
My design goal is to keep the process and the components loosely coupled (the current bsh notwithstanding :P ) such that either can potentially be reused, which is why I am wanting to hold some minimal state in the process context.
Does anyone have any suggestions about how I might work around this? I have an idea how I might modify the SeamVariableResolver to look in the jBPM contexts as well as its own scopes, but this seems like a big hammer.
thanks,
shea.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4033401#4033401
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4033401
17Â years, 9Â months
[JBoss Seam] - Re: datePicker - Doco
by tony.herstellï¼ gmail.com
| <web-app version="2.5"
| xmlns="http://java.sun.com/xml/ns/javaee"
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
|
| <!-- Seam -->
|
| <listener>
| <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
| </listener>
|
| <!-- Propagate conversations across redirects -->
|
| <filter>
| <filter-name>Seam Redirect Filter</filter-name>
| <filter-class>org.jboss.seam.servlet.SeamRedirectFilter</filter-class>
| </filter>
|
| <filter-mapping>
| <filter-name>Seam Redirect Filter</filter-name>
| <url-pattern>*.seam</url-pattern>
| </filter-mapping>
|
| <!-- JSF -->
|
| <context-param>
| <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
| <param-value>client</param-value>
| </context-param>
|
| <context-param>
| <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
| <param-value>.xhtml</param-value>
| </context-param>
|
| <context-param>
| <param-name>facelets.DEVELOPMENT</param-name>
| <param-value>true</param-value>
| </context-param>
|
| <servlet>
| <servlet-name>Faces Servlet</servlet-name>
| <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
| <load-on-startup>1</load-on-startup>
| </servlet>
|
| <!-- Faces Servlet Mapping -->
|
| <servlet-mapping>
| <servlet-name>Faces Servlet</servlet-name>
| <url-pattern>*.seam</url-pattern>
| </servlet-mapping>
|
| <!-- MyFaces -->
|
| <listener>
| <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
| </listener>
|
| <!-- Session Timeout -->
| <session-config>
| <session-timeout>15</session-timeout>
| </session-config>
|
| </web-app>
|
|
in faces.config
| <!-- Facelets support -->
|
| <application>
| <view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
| </application>
|
| <!-- Select one of the two standard persistence lifecycle models for the Seam application -->
|
| <lifecycle>
| <phase-listener>
| org.jboss.seam.jsf.SeamPhaseListener
| </phase-listener>
| </lifecycle>
|
| <!-- My Messages Please -->
| <application>
| <message-bundle>de.co.clickstream.i18n.jsfstandarderrors</message-bundle>
| </application>
|
What do I need to change?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4033399#4033399
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4033399
17Â years, 9Â months
[JBoss Seam] - Keep losing my conversation with A4J and one page
by andrew.rw.robinson
I keep losing my conversation when using a redirect.
Environment:
Seam 1.1.6
A4J 1.1.0
MyFaces 1.1.5
Page flow:
1) user hits landing page (conversation started from pages.xml)
2) user clicks link (conversation still active, also a join=true used on action method)
3) user fills out information and then clicks another link (action is a string, conversation is still running)
4) custom navigation handler executes redirect using "facesContext.getExternalContext().redirect(page);" (conversation is still active -- and stored)
5) New view is "restored"
6) Render response is started and my pages.xml action method is called for the new page (returns success which doesn't match any rules)
7) conversation stored
8) Restore view is called again (this is a bad sign, not sure why this is happening)
9) I get the message "No stored conversation, or concurrent call to the stored conversation" from Manager
10) render response called again, but my page is now broken since the conversation ID has been lost.
Log flow:
| DEBUG [BaseFilter] Filter start request processing at 3/30/07 5:45 PM for uri: /OSoft/pages/ContentMgmt/landing.jsf
| DEBUG [DebugPhaseListener] The phase RESTORE_VIEW(1) is about to start.
| DEBUG [Manager] Found conversation id in request parameter: 25
| DEBUG [Manager] Restoring conversation with id: 25
| DEBUG [DebugPhaseListener] The phase RESTORE_VIEW(1) has completed.
| DEBUG [DebugPhaseListener] The phase APPLY_REQUEST_VALUES(2) is about to start.
| DEBUG [DebugPhaseListener] The phase APPLY_REQUEST_VALUES(2) has completed.
| DEBUG [DebugPhaseListener] The phase PROCESS_VALIDATIONS(3) is about to start.
| DEBUG [DebugPhaseListener] The phase PROCESS_VALIDATIONS(3) has completed.
| DEBUG [DebugPhaseListener] The phase UPDATE_MODEL_VALUES(4) is about to start.
| DEBUG [DebugPhaseListener] The phase UPDATE_MODEL_VALUES(4) has completed.
| DEBUG [DebugPhaseListener] The phase INVOKE_APPLICATION(5) is about to start.
| DEBUG [ActionPaneBean] Checking action pane navigation for action 'nav.step2' and outcome 'nav.step2'. Current view is /pages/ContentMgmt/landing.xhtml and current action pane view is /pages/ContentMgmt/actionPane/editWebPage1.xhtml.
| DEBUG [ActionPaneBean] Redirecting:
| Parent View ID: /pages/ContentMgmt/editWebPage.xhtml
| Action View ID: /pages/ContentMgmt/actionPane/editWebPage2.xhtml
| DEBUG [NavigationHandlerImpl] handleNavigation fromAction=nav.step2 outcome=nav.step2 no matching navigation-case found, staying on current ViewRoot
| DEBUG [Manager] Storing conversation state: 25
| DEBUG [DebugPhaseListener] The phase INVOKE_APPLICATION(5) has completed.
| DEBUG [BaseXMLFilter] Create AJAX redirect response to url: /OSoft/pages/ContentMgmt/editWebPage.jsf?conversationId=25&conversationIsLongRunning=true
| DEBUG [BaseFilter] Finished request processing total time 504ms for uri: /OSoft/pages/ContentMgmt/landing.jsf
| DEBUG [BaseFilter] Filter start request processing at 3/30/07 5:45 PM for uri: /OSoft/pages/ContentMgmt/editWebPage.jsf
| DEBUG [DebugPhaseListener] The phase RESTORE_VIEW(1) is about to start.
| DEBUG [Manager] Found conversation id in request parameter: 25
| DEBUG [Manager] Restoring conversation with id: 25
| DEBUG [DebugPhaseListener] The phase RESTORE_VIEW(1) has completed.
| DEBUG [DebugPhaseListener] The phase RENDER_RESPONSE(6) is about to start.
| DEBUG [ActionPaneBean] Checking action pane navigation for action '#{webPageBean.onLoad}' and outcome 'success'. Current view is /pages/ContentMgmt/editWebPage.xhtml and current action pane view is /pages/ContentMgmt/actionPane/editWebPage2.xhtml.
| DEBUG [ActionPaneBean] Result is not configured for the action pane, delegating to faces navigation handler
| DEBUG [NavigationHandlerImpl] handleNavigation fromAction=#{webPageBean.onLoad} outcome=success no matching navigation-case found, staying on current ViewRoot
| DEBUG [Manager] Storing conversation state: 25
| DEBUG [DebugPhaseListener] The phase RENDER_RESPONSE(6) has completed.
| DEBUG [BaseFilter] Finished request processing total time 20083ms for uri: /OSoft/pages/ContentMgmt/editWebPage.jsf
| DEBUG [DebugPhaseListener] The phase RESTORE_VIEW(1) is about to start.
| DEBUG [Manager] No stored conversation, or concurrent call to the stored conversation
| DEBUG [DebugPhaseListener] The phase RESTORE_VIEW(1) has completed.
| DEBUG [DebugPhaseListener] The phase RENDER_RESPONSE(6) is about to start.
| DEBUG [Manager] Discarding conversation state: 26
| DEBUG [DebugPhaseListener] The phase RENDER_RESPONSE(6) has completed.
|
I am a bit baffled by this. I am using the A4J AJAX links and even tried adding:
<f:param name="conversationId" value="#{conversation.id}"/>
| <seam:conversationPropagation type="join"/>
Any ideas on what may be going on?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4033395#4033395
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4033395
17Â years, 9Â months
[JBoss Seam] - Re: Seam and Adobe Flex
by DavidInTx
The primary reason we're waiting on web services instead of remoting is that prior to Flash 8, communicating from within a flash object out to some javascript on the containing page a return value was rather difficult. Seam Remoting relies on the fact that you can communicate with and get a value back from remote.js (a javascript file provided by Seam that you include in your pages). With Flash 8, there is now an ExternalInterface command which lets you do whatever communication you want. As you can see here , going from flash to javascript prior to ExternalInterface relied on getURL or fscommand. As you can see here and here neither of those methods actually returns a value.
If you can rely on flash 8 being installed, then it doesn't make much difference. Here's how you would do it via remoting
Remoting:
| var customers = EnternalInterface.call(Seam.Component.getInstance("customerAction").getAllCustomers());
|
and here's what you would do for Web Services:
| <soap name="mySOAP" wsdl="http://myServer/customerAction.wsdl">
| <handler>
| var customers = mySOAP.proxy.getAllCustomers();
| </handler>
| </soap>
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4033390#4033390
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4033390
17Â years, 9Â months