[JBoss jBPM] - variable validation
by twiceknightly
Hi,
I have been considering how to integrate jbpm within an application and would like to know how other people have approached this and if they could offer some advice. I'm new to this kind of approach and it's taking some time to get it straight in my mind how my application will interact with jbpm.
My app consists of a JSF based web app. The backing beans use a service locator to call out to a stateless session bean. All the jbpm goodness is contained within the EJB. i.e. separation of layers. So for example the webapp requests the current task instance by calling the EJB. I then transform all the variables and values (and if they are readable,writable etc) to my own DTOs. It is these DTOs that get pass back and forth between the webapp and EJB.
I was thinking about
- How/where to do validation of variables. How do I store and pass around the variable types. Perhaps passing their type to the webapp via the DTOs? Obviously I need to do validation of variable values in the EJB. Would it be best to subclass the controller class for this? I'm thinking that I need validation for every node in the graph with variables. Therefore I need to provide something like struts forms, one for each node, perhaps using the apache validator stuff? So perhaps the EJB reads in an XML file that contains a declaration of a "form" for each node in the graph. Within a single "form" declaration is a declaration for each field and it's type. The EJB will then validate values from the UI before calling the jbpm api to set them in the process.
- How and when to transform the process variables to my "model" and vice versa. The process is passing around individual fields as name value pairs. At somepoint I need to create a new object in my application model and copy the fields into that pojo. I already have my model sorted out. Perhaps I do that by having my subclass of action call another "resource" that can transform in both directions when in a start or end state.
- returning the current state of the process. If I think about an app in terms of MVC my EJB calling jbpm have effectively now become the model and the controller. My web app is now just a dumb set of views. Some how I need to pass back info to the webapp to tell it were in the process we are so it can display the correct screen. Probably I can get away with passing back the current task when calling end on the current task instance. This feels a bit naff though. The model is update by the controller (i.e. EJB and jbpm) but there isn't a way to push the current state to the web app. i.e. there is no way for the controller to tell the view that the model has changed. I guess the webapp (view) could request the state but that's a bit naff as well.
Any thoughts or suggestions are welcome.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4121643#4121643
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4121643
18 years, 5 months
[Installation, Configuration & DEPLOYMENT] - Re: Services with EJB dependency do not start up
by tina99
"jaikiran" wrote : Maybe the name of the service corresponding to your EJB has changed from 4.0.5 to 4.2.2. Go the jmx-console (http://localhost:8080/jmx-console) and see what's the name of the service which corresponds to your EJB and then use this in the depends tag of your MBean
Hi,
thanks four your hint. But I still cannot find it out. Now I prepared a litte test:
I created a little test with just one EJB3 SessionBean and a JBoss Scheduler which depends on this Session Bean.
I try to deploy the EJB3 app to JBoss 4.2.2.ga - so far with little success because I cannot get the Scheduler to work.
In my META-INF subfolder of jbosstest.sar I put the jboss-service.xml for a ReImportScheduler with the following content:
| <server>
| <mbean code="org.jboss.varia.scheduler.Scheduler" name="de.jbosstest:service=ReimportScheduler">
| <attribute name="StartAtStartup">true</attribute>
| <attribute name="SchedulableClass">de.jbosstest.service.ReImportScheduler</attribute>
| <attribute name="InitialStartDate">NOW</attribute>
| <attribute name="SchedulePeriod">3000</attribute>
| <attribute name="InitialRepetitions">-1</attribute>
| <depends>jboss.j2ee:service=EJB3,plugin=pool,jndiName=ImportManagerBean/remote</depends>
| </mbean>
| </server>
|
As you can see the ReImportScheduler depends on an ImportManagerBean which is a Stateless Session Bean.
After creating the EAR I deployed the jbosstest.ear in my JBoss 4.2.2.ga and got the following log statements:
| ...
| 13:00:30,607 INFO [EJBContainer] STARTED EJB: de.jbosstest.ejb.ImportManagerBean ejbName: ImportManagerBean
| 13:00:30,994 INFO [EJB3Deployer] Deployed: file:/home/tina/development/server/jboss-4.2.2.GA/server/default/deploy/JBossServiceTest-ejb.jar
| 13:00:31,420 INFO [TomcatDeployer] deploy, ctxPath=/jmx-console, warUrl=.../deploy/jmx-console.war/
| 13:00:32,211 ERROR [URLDeploymentScanner] Incomplete Deployment listing:
|
| --- MBeans waiting for other MBeans ---
| ObjectName: de.jbosstest:service=ReImportScheduler
| State: CONFIGURED
| I Depend On:
| jboss.j2ee:service=EJB3,plugin=pool,jndiName=ImportManagerBean/remote
|
| --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
| ObjectName: jboss.j2ee:service=EJB3,plugin=pool,jndiName=ImportManagerBean/remote
| State: NOTYETINSTALLED
| Depends On Me:
| de.jbosstest:service=ReImportScheduler
|
|
| 13:00:33,170 INFO [Http11Protocol] Starting Coyote HTTP/1.1 on http-127.0.0.1-8080
| 13:00:33,308 INFO [AjpProtocol] Starting Coyote AJP/1.3 on ajp-127.0.0.1-8009
| 13:00:33,823 INFO [Server] JBoss (MX MicroKernel) [4.2.2.GA (build: SVNTag=JBoss_4_2_2_GA date=200705111440)] Started in 1m:7s:704ms
|
Obviously the ImportManagerBean has been started. The ReImportScheduler has also been configured successfully. However, the
URLDeploymentScanner informs about an incomplete deployment. As a result the ReImportScheduler has not been started. The global JNDI View
exposes that:
| +- ImportManagerBean (class: org.jnp.interfaces.NamingContext)
| | +- remote (proxy: $Proxy86 implements interface de.jbosstest.ejb.ImportManagerRemote,interface org.jboss.ejb3.JBossProxy)
| | +- local (proxy: $Proxy87 implements interface de.jbosstest.ejb.ImportManagerLocal,interface org.jboss.ejb3.JBossProxy)
|
The mbean view of the domain jboss.j2ee for ImportManagerBean states
| MBean Name: Domain Name: jboss.j2ee
| service: EJB3
| name: ImportManagerBean
| jar: JBossServiceTest-ejb.jar
| MBean Java Class: org.jboss.ejb3.stateless.StatelessDelegateWrapper
|
Does anyone can point out where the misconfiguration is? Why does it state NOTYETINSTALLED when apparently the ImportManagerBean
has been started?!
Thanks for any help.
Tina
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4121641#4121641
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4121641
18 years, 5 months
[JBoss Seam] - Re: Another conversation question: how to correctly begin on
by jacob.orshalick
I use pages.xml which, IMO, puts the logic where it belongs as generally conversations are scoped to a section of the application. As page flow is defined in the pages.xml file, it makes sense to demarcate the boundaries of the conversation there.
"MSchmidke" wrote : 2. Beginning a conversation by <begin-conversation flush-mode="MANUAL"> in pages.xml.
| - violates DRY
| - scatters business logic (program logic details in a xml file? why??).
| - impossible to reload the page ("begin called from long running ...")
I'm not sure why you feel this violates DRY or scatters business logic. You define your conversation logic in one location in the pages.xml which is where the pageflow is defined (so it *feels* like the right place) and it should not be repeated anywhere else. You then use s:links to specify propagation="none" when moving between conversations (or simply use h:outputLink based on your needs).
Generally if you are having issues with reloading the page, you need to specify propagation=join and/or rules around when the conversation should be started in the pages.xml. This is quite easy with the support that pages.xml provides.
Hope that helps.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4121639#4121639
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4121639
18 years, 5 months