[JBoss jBPM] - Re: Ending tasks manually
by wurzelbutz
are you sure .getLeavingTransition("refusee") returns the correct one?
maybe cou could try this
| try {
|
| processInstance = jbpmContext.loadProcessInstance(processInstanceId);
|
| TaskMgmtSession taskMgmtSession = jbpmContext.getTaskMgmtSession();
| @SuppressWarnings(value={"unchecked"}) //taskMgmtSession returns a raw List... We ignore the warning thrown by Java
| List<TaskInstance> userTaskList = taskMgmtSession.findTaskInstances(demande.getValideur().getUsername());
|
| for(int i = 0 ; i < userTaskList.size() ; i++)
| {
| TaskInstance taskInstance = userTaskList.get(i);
| if(taskInstance.getProcessInstance().getId() == processInstanceId)
| {
| if(taskInstance.getName().equals("valider_demande"))
| {
| processInstance.getContextInstance().setVariable("demande", demande);
| taskInstance =jbpmContext.getTaskInstance(taskInstance.getID());
| Transition tr=taskInstance.getTask().getTaskNode().getLeavingTransition("refusee");
| taskInstance.end(tr);
| break;
| }
| }
| }
|
| }
|
|
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4233518#4233518
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4233518
16 years, 11 months
[Security & JAAS/JBoss] - @RunAs in JBoss 5 - Caller unauthorized in second call
by komet_1978
Hallo,
I've noticed the following strange behaviour using the @RunAs annotation in a secured STSB.
I've tried JBoss 5.0.1.GA and 5.1.0.GA.
Take a look at the following simple scenario: three secured STSBs Caller, A and B. Caller runs as Admin defined by @RunAs("Admin") annotation and uses the role Admin for all method calls on other STSBs, STSB A allowes access only by Admins (realize by @RolesAllowed("Admin") annotation) , the same definition can be found in the STSB B. All STSBs are in the same security domain defined by @SecurityDomain("foo").
1) Authorized Client calls Caller method (the Client hasn't got the role "Admin")
2) Caller method calls A method (as a "Admin")
3) A method calls B method. (I supposed that the "Admin" role is propagated to the second call)
1) and 2) are ok.
3) throws "Caller unauthorized" exception.
Is this a bug or a feature?
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4233507#4233507
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4233507
16 years, 11 months
[JBoss jBPM] - Re: Ending tasks manually
by frinux
Hum I'm encountering the same problem, but I can't make it work. Like you, I want to choose one transition among 2 existing. WHen I try this:
Transition tr=taskInstance.getTask().getTaskNode().getLeavingTransition("refusee");
I get the good transition. But when I do task.end(tr), it always takes the first transition (without any error).
Here is the complete code:
| JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
| try {
|
| processInstance = jbpmContext.loadProcessInstance(processInstanceId);
|
| TaskMgmtSession taskMgmtSession = jbpmContext.getTaskMgmtSession();
| @SuppressWarnings(value={"unchecked"}) //taskMgmtSession returns a raw List... We ignore the warning thrown by Java
| List<TaskInstance> userTaskList = taskMgmtSession.findTaskInstances(demande.getValideur().getUsername());
|
| for(int i = 0 ; i < userTaskList.size() ; i++)
| {
| TaskInstance taskInstance = userTaskList.get(i);
| if(taskInstance.getProcessInstance().getId() == processInstanceId)
| {
| if(taskInstance.getName().equals("valider_demande"))
| {
| processInstance.getContextInstance().setVariable("demande", demande);
| Transition tr=taskInstance.getTask().getTaskNode().getLeavingTransition("refusee");
| taskInstance.end(tr);
| break;
| }
| }
| }
|
| }
|
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4233506#4233506
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4233506
16 years, 11 months
[Clustering/JBoss] - Re: Request going to single server and getting kicked off
by jtcnz
COPY from the guide for JBoss 4.0.3. It might be help. Not sure.
"In JBoss 3.0.x, each client-side stub has its own list of available target nodes. Consequently, some side-effects can
occur. For example, if you cache your home stub and re-create a remote stub for a stateless session bean (with the
Round-Robin policy) each time you need to make an invocation, a new remote stub, containing the list of available
targets, will be downloaded for each invocation. Consequently, as the first target node is always the first in the list,
calls will not seemed to be load-balanced because there is no usage-history between different stubs. In JBoss 3.2+,
the proxy families (i.e., the "First AvailableIdenticalAllProxies" load balancing policy, see Section 16.1.3.2) remove
this side effect as the home and remote stubs of a given EJB are in two different families."
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4233497#4233497
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4233497
16 years, 11 months
[Clustering/JBoss] - Fake instances appear...
by jtcnz
I am running three jboss4.0.3sp1 on windows 2003 as a cluster
After some times unexpected windows OS shutdown on one machine(let's say C), the jboss server on C automatically startup again. But when it starts [TreeCache] service, some unexcepted instances appear. For example, [TreeCache] viewAccepted(): A:1234, B:2345, C:3456, C:5678, C:5679, C:6788, C:6789
C:5678, C:5678 C:6788, C:6789 should not be there!! And YES!! They are the survivors of the last two times server shutdown!!
But I use netstat -ano to check the ports. They are not used at least in the cmd console view. So I guess they are fake instances.
For tomcat clustering(tc5-cluster-service.xml), I use only <FD_SOCK> protocol to do failure detection. It's default.
How can this happen?? And how to avoid this when unexpected windows shutdown can not be avoided at the moment(It happens actually rarely).
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4233494#4233494
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4233494
16 years, 11 months
[JBoss Messaging] - Re: Behavior with selector and fullSize cache
by mclu
Hi !
Thx for explanation. But this basics I know already.
I did the test with a limit of 50 and added a lot of messages for x y and z to my queue. I also undeployed all bridges.
Then I deploy bridge x. All messages in the memory which contains the header property destination=x are bridged then. Some messages are reloaded but after a short time the memory queue contains only messages for y and z. The messages which are paged to db for x are NOT delivered.
If I then deploy Bridge Y some messages of Y and (because of reload) some X are bridged. Then the Queue stopped again because only Z messages are in the memory queue.
If I deploy Z the queue is completely bridged to all destinations.
This behaviour of course makes sense! Paged messages are somehow invisible for the JMS system.
But I think there should be a section in the bridge documentation (user guide) or somewhere else which points to this behaviour. Otherwise users maybe wonder why the queue "stops".
I my case I think I have to create onle queue per destination. Otherwise I can not prevent memory problems if one or more destinations are not reachable.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4233492#4233492
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4233492
16 years, 11 months