[jboss-user] [JBoss jBPM] - Re: Signal a task on a html form submit
Hi, I just come to add precisions on my previous solution (it can eventualy help). Finally there is a big problem with the previous solution : you can't control the result of the servlet and the task is always validated. It didn't matter for me so far... but now I need it. So I came back to the old solution and I'm now validating my task and everything in the servlet with the taskInstance ID I get in EL like that : #{taskInstanceBean.taskInstance.id} View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4051338#4051338 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4051338 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss jBPM] - Re: Signal a task on a html form submit
I just solved my problem. I was trying to get my taskInstance to be signaled with code when I thought about another solution : I don't put a dataform inside my form but the form inside my dataform. This way the default transition button can still work and I just have to put some javascript on it like that : jbpm:dataform | f:facet name=header | Envoyer un fichier local | /f:facet | jbpm:datacell | f:facet name=header | Selectionnez le fichier a envoyer : | /f:facet | form name=uploadFile enctype=multipart/form-data method=POST action=uploadSuivi | input class=file type=file name=suiviXLS/ | input class=text type=hidden name=nomProjet value=#{var['nomProjet']}/ | /form | /jbpm:datacell | | jbpm:datacell | f:facet name=header | h:outputText value=Actions/ | /f:facet | tf:transitionButton transition=OK value=Envoyer onclick=document.forms['uploadFile'].submit();/ | /jbpm:datacell | /jbpm:dataform It works well, my task is validated, the next task is created, my servlet is called and my file saved... I'm happy but I'm feeling very stupid to think about that so late. I knew this should be easy :) Btw I think a little more documentation must be written on EL (some examples would be great) and since jBPM JSF tags are still here in the new admin console and usable from jBPM and JSF users, I think they deserve a little Javadoc like the official JSF one : http://java.sun.com/javaee/javaserverfaces/1.2_MR1/docs/tlddocs/index.html. That's absolutly not a urgent task... but it would help... View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4049612#4049612 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4049612 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss jBPM] - Re: Signal a task on a html form submit
Ok I post you some code and informations... It will not say more that I already said... but ok let's go. Here is my task : task-node name=Creer bilan | task name=bilanCP | assignment actor-id=#{CP} / | /task | transition to=Evaluation DP name=OK/transition | /task-node | Here is my association in the forms.xml : form task=bilanCP form=bilanCP.xhtml/ Here is my bilanCP.xhtml (displaying well) : !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; | |ui:component | form enctype=multipart/form-data method=POST action=uploadSuivi | jbpm:dataform | f:facet name=header | Envoyer un fichier local | /f:facet | jbpm:datacell | f:facet name=header | Selectionnez le fichier a envoyer : | /f:facet | input class=file type=file name=suiviXLS/ | input name=nomProjet type=hidden value=#{var['nomProjet']}/ | input name=tokenId type=hidden value=#{token.getId}/ | /jbpm:datacell | | jbpm:datacell | f:facet name=header | h:outputText value=Actions/ | /f:facet | button class=button type=submitEnvoyer/button | /jbpm:datacell | | /jbpm:dataform |/form | | br / | | jbpm:dataform | f:facet name=header | h:outputText value=Fichier distant modifie/ | /f:facet | | jbpm:datacell | f:facet name=header | h:outputText value=Actions/ | /f:facet | !-- TASKFORM BUTTONS -- | tf:transitionButton transition=OK value=Faire suivre le fichier au DP/ | /jbpm:datacell | /jbpm:dataform | | /ui:component | | /html | and here is my servlet : import java.io.File; | import java.io.IOException; | import java.io.PrintWriter; | import java.util.Iterator; | import java.util.List; | | import javax.servlet.http.HttpServlet; | import javax.servlet.http.HttpServletRequest; | import javax.servlet.http.HttpServletResponse; | | import org.apache.commons.fileupload.FileItem; | import org.apache.commons.fileupload.FileItemFactory; | import org.apache.commons.fileupload.servlet.ServletFileUpload; | import org.apache.commons.fileupload.disk.DiskFileItemFactory; | | public class UploadSuivi extends HttpServlet { | | private static final long serialVersionUID = -7214369336993351418L; | | private FileItem fichier; | private String nomProjet; | private String tokenId; | | public void service(HttpServletRequest request, HttpServletResponse response) throws IOException { | | if (!ServletFileUpload.isMultipartContent(request)) { | throw new RuntimeException(Not a multipart request); | } | | try { | // Create a factory for disk-based file items | FileItemFactory factory = new DiskFileItemFactory(); | | // Create a new file upload handler | ServletFileUpload upload = new ServletFileUpload(factory); | | // Parse the request | List list = upload.parseRequest(request); | | // Process the uploaded items | | for (int i=0; ilist.size(); i++) { | FileItem item = (FileItem) list.get(i); | | if (item.getFieldName().compareTo(suiviXLS) == 0) { | fichier = item; | } | | if (item.getFieldName().compareTo(nomProjet) == 0) { | nomProjet=item.getString(); | } | | if (item.getFieldName().compareTo(tokenId) == 0) { | tokenId=item.getString(); | } | } | | // save the file | File uploadedFile = new File(C:/+nomProjet+.xls); | fichier.write(uploadedFile);
[jboss-user] [JBoss jBPM] - Re: Signal a task on a html form submit
I forget to say it again : I know I may I misunderstood the documentation. I d'ont say it's a bug... but in case I read well it can be... I just don't know and I'm curious about it. What I want now is another solution to get my process instance, token or whatever so I can signal my task in my servlet. I'm sure there's an easy one somewhere but I just don't imagine it yet... View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4049212#4049212 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4049212 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss jBPM] - Re: Signal a task on a html form submit
anonymous wrote : Ok I post you some code and informations... It will not say more that I already said... but ok let's go. Well, tokenId=item.getString(); differs from tokenId=tokenIdItem.getString(); and the accompanying form tells more about the 'correct' implementation than single lines of code, so please let us be the judge of whether it tells more/enough ok ;-) What does the generated form look like in the browser? Does the token field have a value? Maybe try something like #{task.token.id) Whow... now I see where you go wrong.. you do a token.getId instead of token.id.. View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4049240#4049240 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4049240 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss jBPM] - Re: Signal a task on a html form submit
I doesn't work better with id at the end or/and with task in the begining. My field remains empty (and empty in the browser too if not hidden). I tried idParameter instead of id only too (I see that in a jbpm:bind... just in case...) and it doesn't work better. Right now I'm trying to add the processInstance ID to the context variables with an action. That way I'm sure I'll get it in my servlet. It doesn't work yet but it will... I hope it will :) Too bad I have to add code and use a process variable for that though... View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4049288#4049288 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4049288 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss jBPM] - Re: Signal a task on a html form submit
Ronald, I see a lot of instances on the forum of folks who have problems with EL and don't (apparently) have any way to dig into what they've done wrong beyond inspection of their code. It's much more common with transition condition expressions. Do you know if there's any way to turn on EL tracing so that, e.g., in this case, he'd see somewhere in a log a No Such Field 'getId' error message? -Ed Staub View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4049289#4049289 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4049289 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss jBPM] - Re: Signal a task on a html form submit
Ed, This is generic EL stuff ig you have e.g. a class Token with getter/setter like getId/setId, in EL you have to use token.id to have access to it. If it is the jboss imp, it uses log4j, so turning on debug at the rootlevel (and reducing it to the correct classes/packages if you see some interesting stuff) is what I normally do. In the webconsole I see something like: | jbpm:dataarea | h:inputHidden value=#{returnViewId}/ | h:inputHidden value=#{tokenId}/ | ... | /jbpm:dataarea | View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4049299#4049299 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4049299 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss jBPM] - Re: Signal a task on a html form submit
Ronald, anonymous wrote : This is generic EL stuff ig you have e.g. a class Token with getter/setter like getId/setId, in EL you have to use token.id to have access to it. | Yeah, I know... it's just that we all do bonehead things like this once in a while and need a hint about where we screwed up. The log can provide this - maybe. I haven't used it in this area, so I don't know what log output is emitted and whether it is useful. I was hoping you might - I guess not, though! anonymous wrote : If it is the jboss imp, it uses log4j, so turning on debug at the rootlevel (and reducing it to the correct classes/packages if you see some interesting stuff) is what I normally do. Yes... I'm getting a sense that a lot of folks don't have the experience base for this to be an reflexive thing to do. I'm starting to wonder if it makes sense to include a log4j.xml in the config, just to steer folks toward taking advantage of it. I guess JBPM may migrate at some point to use Seam's EL implementation relatively soon, so researching into specifics about log capabilities in the current implementation may not be that useful in the long term. -Ed Staub View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4049313#4049313 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4049313 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss jBPM] - Re: Signal a task on a html form submit
Oh... regarding these logoutputs, I have some experience in combination with seam and there is explicit logging on getters/setters not found on debug level. Sometimes even at error (not sure when exactely) There was a configfile at the debug level, but afaik, there has been a change in policy lately to at least leave the console output with not that high a level and have the fileappender contain more detailed output, so not only look at the console And yes, if it was up to Gavin et al, jBPM would make the switch to their EL impl asap (not sure if that one runs on jdk 1.4 though View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4049318#4049318 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4049318 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss jBPM] - Re: Signal a task on a html form submit
Just some precisions : - I spent lot of time trying everything (taskInstance, processIntance and not only token) in my expressions and I never get any answer. I don't know why since it works well with any simple variable (with #{var['myvar']}). - This input code is in a modified form file created by the GPD. I need to have 2 solutions here : the first is a normal transition link and the second the file upload. They lead to the same unique transition to the next node. I searched the documentation and I understand that the way I do it should work.. is it a bug? (I'm not know EL enough to figure myself) I searched in all the test cases and I didn't find any example of that... did I miss one? I lost nearly a day on that so if you have any little idea... even if it may seem stupid... I'll take it and test it. View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4049148#4049148 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4049148 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss jBPM] - Re: Signal a task on a html form submit
- you describe you deployed 'a servlet' how can we know what goes wrong if you do not show the code - you do not describe what versions of the gpd, core etc, - how do we know what is the original form (you made 'a' form in 'the' xhtml form file) - why do you come to the conclusion that after reading the docs you understand that the way you do it is correct? etc...etc...etc... if you are not more explicit, people cannot help you View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4049157#4049157 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4049157 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user