[JBoss jBPM] - VariablesCommand executed by CommandServiceBean has no effec
by Huber
I'm trying to set variables on a processInstance via the VariablesCommand executed remotely with CommandServiceBean, but it does'nt have any effect (variables are not set, no error in log).
I use the VariablesCommand in the following way:
| Map variablesMap = new HashMap();
| variablesMap.put("anzahlBier", "10");
| VariablesCommand variablesCommand = new VariablesCommand();
| variablesCommand.setTokenId(processInstance.getRootToken().getId());
| variablesCommand.setVariables(variablesMap);
| remoteCommandService.execute(variablesCommand);
|
In the log I can see that the execute-Method of CommandServiceBean is called an that the command is handed over to the command service:
anonymous wrote :
| 2007-09-07 15:18:25,921 DEBUG [org.jbpm.ejb.impl.CommandServiceBean] executing org.jbpm.command.VariablesCommand@1bf756b
| ...
| 2007-09-07 15:18:25,937 DEBUG [org.jbpm.ejb.impl.CommandServiceBean] handing over the command execution to the command service
|
I'm using jbpm-jpdl-suite-3.2.1.
Other commands executed remotely work fine.
Any ideas appreciated!
cheers, johannes
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4082236#4082236
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4082236
18 years, 7 months
[JBoss Seam] - Redirecting to Previous Long Running Conversations
by trickyvail
Seam 2.0.0.BETA1
I would like a shopping website that allows users to have multiple carts open in different browser windows at the same time. Seam's conversation model appears to provide a solution: use a long running conversation for each cart and nested conversations everywhere a regular application would use a conversation.
One of the problems is how to transparently connect a user back to their cart (most recently accessed session) if they leave the site and come back using a url without the conversation id? I've tried the following solution:
| pages.xml (fragment):
|
| <page view-id="*" action="#{conversationManager.manage}">
|
| ConversationManager.java:
|
| @Name("conversationManager")
| @Scope(ScopeType.SESSION)
| public class ConversationManager
| {
| private Stack<String> conversationStack = new Stack<String>();
|
| public String manage()
| {
| Manager manager = Manager.instance();
| HttpServletRequest httpServletRequest = (HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest();
| String conversationIdRequestParameter = httpServletRequest.getParameter(manager.getConversationIdParameter());
|
| if(! manager.isLongRunningOrNestedConversation())
| {
| ConversationEntries conversationEntries = ConversationEntries.instance();
|
| if(conversationEntries.getConversationEntries().size() == 0)
| {
| manager.beginConversation();
| conversationStack.push(Conversation.instance().getId());
| }
| else if
| (
| conversationEntries.getConversationEntries().size() > 0
| && conversationIdRequestParameter == null
| )
| {
| while(conversationStack.size() > 0)
| {
| String conversationId = conversationStack.pop();
| ConversationEntry conversationEntry = conversationEntries.getConversationEntry(conversationId);
| if(conversationEntry != null)
| {
| conversationEntry.redirect();
| }
| }
| }
| }
| else if(manager.isLongRunningConversation())
| {
| try
| {
| if(conversationStack.peek() != Conversation.instance().getId())
| {
| conversationStack.remove(Conversation.instance().getId());
| conversationStack.push(Conversation.instance().getId());
| }
| }
| catch(EmptyStackException e){}
| }
|
| return null;
| }
| }
For every view the manage method:
- begins a long running conversation for new sessions.
- for requests that have conversations but no conversation id, redirects to last accessed existing conversation.
I've not tested this extensively but it appears to work as intended.
Because the conversation holds the cart, its timeout should be set to a long span. However when creating nested conversations it would be preferable for them to have a short span. Here's where I've run into a problem. I can set the conversation timeout like so:
Conversation.instance().setTimeout(int);
but as soon as I go to the next page the timeout will be back to the default setting. I've would like to use an approach like:
ConversationEntries.instance().getConversationEntry("2").setTimeout(int);
which would set the ConversationEntry dirty, but this method is not visible.
Here are my questions:
=============================================
- How do you permanently change a conversation's timeout?
- Is there a better multiple cart solution without hijacking the seam conversation model? (e.g. storing the carts in the sesssion and creating management similar to conversations)
- If this is an acceptable solution would it be better implemented as a servlet filter instead of mapping an action to the "*" view in pages.xml?
=============================================
Thanks in advance for your feedback.
references:
http://www.jboss.com/index.html?module=bb&op=viewtopic&t=109084
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4082227#4082227
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4082227
18 years, 7 months
[Management, JMX/JBoss] - Scheduler Delay
by ctormo
Hi,
I am currently implementing MBeans to schedule several classes. For that purpose, I am using the javax.management.timer.Timer class as timer.
Here you can see an exemple:
| <mbean code="javax.management.timer.Timer"
| name="app.timer:service=Scheduler">
| </mbean>
|
|
| <mbean code="org.jboss.varia.scheduler.Scheduler"
| name="app.timer:service=TheScheduler">
| <attribute name="StartAtStartup">true</attribute>
| <attribute name="SchedulableClass">myClass</attribute>
| <attribute name="SchedulableArgumentTypes">MyTypes</attribute>
| <attribute name="SchedulableArguments">MyArgs</attribute>
| <attribute name="InitialStartDate">01/01/1970 22:00</attribute>
| <attribute name="SchedulePeriod">86400000</attribute>
| <attribute name="InitialRepetitions">-1</attribute>
| <depends>app.timer:service=Scheduler</depends>
| </mbean>
|
|
The execution of the class takes 15 minutes (it finishes at 22:15), which makes the second execution start at 22:15 the following day, whereas we need it to be started at 22:00.
Any ideas related to this delay?
Do you know how to avoid it?
Thank you in advance.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4082226#4082226
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4082226
18 years, 7 months