[JBoss jBPM] - Form Generation
by djf57
I've created a trivial business process and then generated a form for one of the tasks.
However:
The mapped name that I associate with the process variable does not appear get redisplayed if I recreate the form.
The process redeploys without error but the new fields are not displayed. Even simple HTML added manually to the generated .xhtml file does not appear in the web console - though it does appear in the IE previewer.
Am I doing something stupid or is this a bug - I strongly suspect the former but have been round this loop several times, restarting the server etc but to no avail. Appended are the process definition and generated/manually edited xhtml file.
Thanks
David
processdefinition.xml:
<?xml version="1.0" encoding="UTF-8"?>
<process-definition xmlns="" name="startersProcess">
<assignment actor-id='ernie'>
<assignment actor-id='grover'>
<assignment actor-id='bert'>
<start-state name="Ship Order Return">
Transitioning from Shipping to Receive Return
</start-state>
<task-node name="Receive Return">
</task-node>
<task-node name="Update Order">
</task-node>
<task-node name="Return Money">
</task-node>
<end-state name="end1"></end-state>
</process-definition>
Send-Item.xhtml:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:c="http://java.sun.com/jstl/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:tf="http://jbpm.org/jsf/tf"
xmlns:jbpm="http://jbpm.org/jsf">
<h1>Why does this not appear in the web console?</h1>
<jbpm:dataform>
<f:facet name="header">
<h:outputText value="#{taskName}"/>
</f:facet>
<!-- TASKFORM ROWS -->
<jbpm:datacell>
<f:facet name="header">
<h:outputText value="tracking number"/>
</f:facet>
<h:inputText value="#{var['tracking number']}" />
</jbpm:datacell>
<jbpm:datacell>
<f:facet name="header">
<h:outputText value="added by DJF"/>
</f:facet>
<h:inputText value="#{var['attr2']}" />
</jbpm:datacell>
<jbpm:datacell>
<f:facet name="header">
<h:outputText value="Actions"/>
</f:facet>
<!-- TASKFORM BUTTONS -->
<tf:saveButton value="Save"/>
<tf:cancelButton value="Cancel"/>
<tf:transitionButton transition="Shipping" value="Shipping"/>
</jbpm:datacell>
</jbpm:dataform>
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4051736#4051736
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4051736
18Â years, 10Â months
[JBoss Seam] - Customizing error handling
by gonzalad
Hello,
I would like to implement a generic error handling mecanism with Seam in order to catch and log exceptions generated from whatever the Jsf phase.
After having a look at Seam source code, I have found a - limited - solution for this, but before going on :
1. is there's a better way to do it.
2. if this is the way to go would it make some sens to create protected accessors (getters/setters) to exceptionHandlers attribute
of Seam Exceptions class in order to be able to access this list from my child class ?
3. know how I can catch ALL jsf errors.
Since I want to build a generic error handling mecanism, I don't want to use pages.xml [1]
For question 1 & 2 here's a sample code (didn't try to run or compile it - just for the idea) :
In order to plugin my generic error handling, I'll create my own org.jboss.seam.core.exceptions component which will inherit from
org.jboss.seam.core.Exceptions.
@Scope(ScopeType.APPLICATION)
| @Intercept(NEVER)
| @Install(precedence=FRAMEWORK)
| @Name("org.jboss.seam.core.exceptions")
| public class Exceptions extends org.jboss.seam.core.Exceptions
| {
|
| /**
| * <p>Need to redeclare this list since it's declared private on parent class.</p>
| */
| protected List<ExceptionHandler> myExceptionHandlers = new ArrayList<ExceptionHandler>();
|
| public void handle(Exception e) throws Exception
| {
| //build a list of the nested exceptions
| List<Exception> causes = new ArrayList<Exception>();
| for (Exception cause=e; cause!=null; cause=EJB.getCause(cause))
| {
| causes.add(cause);
| }
| //try to match each handler in turn
| for (ExceptionHandler eh: exceptionHandlers)
| {
| //Try to handle most-nested exception before least-nested
| for (int i=causes.size()-1; i>=0; i--)
| {
| Exception cause = causes.get(i);
| if ( eh.isHandler(cause) )
| {
| eh.handle(cause);
| return;
| }
| }
| }
|
| //finally, call parent Exceptions handle
| super.handle (e);
| }
|
| @Create
| public void initialize() throws Exception
| {
| super.initialize();
| ExceptionHandler anyhandler1 = MyExceptionHandler();
| myExceptionHandlers.add( new AnnotationRedirectHandler() );
| }
| }
For question 3, I've made a few tests, Seam exception handling intercepts errors throw during INVOKE_APPLICATION_PHASE
and RENDER_VIEW_PHASE.
Errors during UPDATE_MODEL_VALUES phase are not handled (i.e. when throwing an nuchecked exception from a managed bean setter).
Don't know the handling for RESTORE_VIEW(1), APPLY_REQUEST_VALUES(2), PROCESS_VALIDATIONS(3).
Is there a way to handle all those errors ?
Thank you very much for your help
[1] : The main purpose of this error handling is to systematically log errors. I'll have a publish / subscribe mechanism used for other applications
(i.e. batch application), and want to reuse it for Seam applications)
I don't want to use pages.xml for that, since all applications I'm going to build will use this same
error logging mechanism. Application will use pages.xml to handle errors i.e. to navigate to an error page.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4051724#4051724
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4051724
18Â years, 10Â months