[JBoss jBPM] - Re: JBPM Identity
by kukeltje
anonymous wrote : Thanks again Ronald, :)
Now can you imagine that some people think I'm rude? ;-)
anonymous wrote : 'cause as I looked at the jBPM's source code, I saw that use of the identity ExpressionAssignmentHandler is hardcoded in the readAssignmentDelegation function of "JpdlXmlReader" class when the tag "expression" is used.
|
Unfortunately you are correct...
anonymous wrote : So, I have to change "JpdlXmlReader" or I have to assign all tasks using a handler and an input expression.
Unfortunately this is the case so you are right again.
anonymous wrote : But it seems that I can't use the "expression" tag of jPDL also (Am I right?)
Spot on
anonymous wrote :
| Thanks,
| --Sherry
You are welcome...
Btw, in jBPM 4 this will be easier afaik (not tried it yet, no time :-( )
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4233565#4233565
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4233565
15 years, 6 months
[JBoss jBPM] - Re: JBPM Identity
by kukeltje
Ok, here is another quick reply ;-)
Well, you are kind of there, but not completely. I have to admit, the area of extending/overriding the identitycomponent and/or the ExpressionAssignmentHandler is/was kind of not really flexible and certainly not realy documented well.
I think the best/easiest way is to not use the identity component and explicitly put AssignmentHandlers on tasks/swimlanes and not use expressions explicitly, at least not the jpdl expressions. You could pass a string param to your custom assignmenthandler which is in fact the expression you want to use and evaluate that in your assignmenthandler. The downside to this is that you have to explicitly put the assignmenthandler everywhere you want it. This is already reduced when using swimlanes btw.
hth a little
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4233549#4233549
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4233549
15 years, 6 months
[JBoss jBPM] - Re: JBPM Identity
by Sherrys
Thank you for your fast reply Ronald,
By blah, I mean any kind of expression in my process definition:
<?xml version="1.0" encoding="UTF-8"?>
| <process-definition xmlns="urn:jbpm.org:jpdl-3.2" name="test2">
|
| <start-state name="start-state1">
| <transition to="task-node1"></transition>
| </start-state>
|
| <task-node name="task-node1">
| <task name="test2task">
| <assignment expression="blah"></assignment>
| </task>
| <transition to="end-state1"></transition>
| </task-node>
|
| <end-state name="end-state1"></end-state>
|
| </process-definition>
By seeing the "expression" in the definition, jBPM should call the identity component (am I right?) I've removed the identity mappings from my hibernate.cfg, and implemented AssignmentHandler myself (I also extended the ExpressionAssignmentHandler but it didn't help either). As a result, I expect jBPM to call my assignmentHandler instead of identity's.
In my assignment handler, I set the assignable's actorId to 12 (which is defined in the User table of the DB, although I know that this table is used by the Identity component)
It seems that while creating a new instance of task, jBPM should call my assignment handler and not to use the identity component. so, it should returns a user with id 12, but it throws an identity exception
thnx
--Sherry
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4233529#4233529
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4233529
15 years, 6 months
[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
15 years, 6 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
15 years, 6 months