[JBoss Seam] - Re: Remove from list using EntityHome
by lightbulb432
"petemuir" wrote : My best guess as to why it fails from what you've said is that by passing the instance through the datamodel like that it has become unmanaged so cannot be removed - you can check this by calling entityManager.contains(). Setting by Id rather than instance might just work (use it with my.getId rather than rowIndex).
Where should I set the breakpoint in my debugger to do an entityManager.contains() check?
Or if it's better to output a FacesMessage with this value, where should I put that debugging line?
anonymous wrote : And beware of the fact that a remove won't remove the entity from memory - it just detaches it from the persistence context.
So the refreshed page after the delete would still show the removed entity in the list right? But if I look in my DB, am I correct to say I should no longer see it there (if things work correctly) even though it's still in memory?
Next question is why does this happen - isn't entity-query EVENT-scoped, which means that on the next refresh it doesn't exist and has to hit the DB again?
Thanks a lot.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4017709#4017709
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4017709
19Â years, 2Â months
[JBoss jBPM] - Re: Implementing data flow
by drjava
Ed- Thoughtful points, thank you.
The way I'm imagining it, with the added input and output constructs in the jpdl, nodes could declare n "ports" that take or produce certain types of data. The code in the node, or handler I guess, would be responsible for retrieving data from an input and staging data on an output. The execution engine could then handle moving the data structures in and out of the process variable space using a naming convention that would identify them as belonging to inputs or outputs. For example, when a node would call, getInput(String portName) let's say, then some infrastructure code would look for the corresponding input in the process variable map, return the object, and remove it from the process variable map. Conversely, when a node wanted to stage an output, it would call setOutput(String portName, Object output), and infrastructure code would handle moving the data into the process variable map using the specified naming convention.
Using this mechanism, I think the scenarios you describe could be prevented. But I might be missing something. Also, process variables would work just as they currently do, but would be overloaded to support data flow.
Maybe this sounds a lot like a hack, but I was just brainstorming about how this could be implemented with the least amount of work up front.
Your point about cluttering up the process graph is well taken. I concur that another "view" of the graph would be required specifically for the data flow to reduce the complexity.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4017702#4017702
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4017702
19Â years, 2Â months
[JBoss Seam] - Re: Remove from list using EntityHome
by lightbulb432
I was afraid you'd say that :) Just kidding...I actually experimented with a different approach, and it goes about 90% of the way...maybe you could tell me why it isn't working. (Sure I'll end up using the parameters way if this doesn't work, but working through this will help me understand Seam better...)
In my components.xml:
<!-- where myEntityQuery is also defined in this components.xml -->
| <factory name="myFactory" value="myEntityQuery.dataModel" />
In my xhtml within an h:column:
<h:commandLink value="..." action="#{myEntityHome.remove}" />
In my MyEntityHome:
@In("#{myFactory.rowData}")
| public void setInstance(MyEntity my) {
| super.setInstance(my);
| }
Believe it or not, this setup goes about 90% of the way in my debugger...the "my" parameter gets correctly passed to setInstance, the EntityHome's "instance" variable is set correctly, and the remove method is called while instance is set! But for some reason the entity doesn't get removed, setInstance then gets called a second time before the request is over, this time with null passed to setInstance.
Why might setInstance be getting called twice? I don't think I'm doing anything special apart from what I've indicated above... Please help.
I could try using rowIndex instead of rowData and setting the id instead of the instance, but I'm not sure that would change anything...
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4017692#4017692
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4017692
19Â years, 2Â months