-
1. Re: Hi ,unable to map variables in Human Task
dosten Dec 19, 2014 10:47 AM (in response to khirod_panda)What is your question?
-
2. Re: Hi ,unable to map variables in Human Task
khirod_panda Dec 22, 2014 10:16 AM (in response to dosten)HI Darren ,
Thanks for looking into this .
I am trying to pass a varibale from start node to 2nd task in my flow and do some Math calculation in the 2nd Human task and then show the result (may be system out in 2nd task ).
But i am not able to pass the varibale successfullt to diffrenet tasks.
-
3. Re: Hi ,unable to map variables in Human Task
dosten Dec 22, 2014 2:12 PM (in response to khirod_panda)It is hard to tell on the screenshots, but do you have a output mapping from tNo1 back to pNo1?
-
4. Re: Hi ,unable to map variables in Human Task
khirod_panda Dec 22, 2014 9:51 PM (in response to dosten)HI Darren ,
Thanks for looking into this .
let me put in detail what am doing or betetr trying to do :-
I want to pass 2 varibales and an operator (i.e + or - )
from Start task to task 1 and check the values in Stask 1 if all values are present then passon the same details to Task 2 and then do an arithmetic operation based on the OPerator (i.e. + or -) .
so what i have done is :-
i have defined follwoing varibales at process level (as u can see in screen shot 1)
- pNo1
- pNo2
- pOpr
- pResult
- tNo1
- tNo2
- tOpr
- tResult
now to get the varibale in Task1 , I have mapped in I/O Parameter mapping , in INput Parameter mapping follwoing :-
- Hello World/pNo1 to pNo1
Hello World/pNo2 to pNo2
- Hello World/pOpr to pOpr
Then i am printing the values in Task1 as SOP for all 3 values System.out.print(pOpr) and ia m able to see all the 3 values and can see that values are present
Now my job is to pass on the same value to Task 2 for the arithmetic operation , for that what i am doing is :-
defining in outpout parameter mapping as following
- Hello World/pNo1 to tNo1
- Hello World/pNo2 to tNo2
- Hello World/pOpr to tOpr
then in the Task 2 i am trying to see if i am getting the value of tNo1, tNo2, tOpr but i see it is null there .
i should get teh values as passed and then do a arithmetic operation and print the values in Task2.
Hope this will help you to get teh details and help me .
Thanks
-
5. Re: Hi ,unable to map variables in Human Task
dosten Dec 23, 2014 9:47 AM (in response to khirod_panda)Your output mapping looks to be backwards. You need to map the input variables back out to the process variables if you want them available in other tasks. So in your example, pNo1, pNo2 and pOpr are local to Task1. You need to make output mappings back to Hello World/pNo1 etc. I don't use the Eclipse editor so I am not sure how to do the mapping there.
-
6. Re: Hi ,unable to map variables in Human Task
sanjay05222 Dec 24, 2014 2:08 PM (in response to khirod_panda)Hi Khirod
I havent gone that far to use eclipse but I believe this can provide you some insight into how to map them all.
Process Level
TestClient1 Task Level Data Input
TestClient1 Task Level Data Output
Test Client Mapping Level Assignments Level
I believe if you run the co-relation between these screen shots you might be able to get the eclipse thing get going or might be able to rationalize how it should be in the eclipse GUI.
I would as well open the bpn process inside the eclipse the same one this is a standard jbpm-playground example which you can open and try to find out how they are correctly map.
Sanjay
-
7. Re: Hi ,unable to map variables in Human Task
sanjay05222 Dec 24, 2014 2:23 PM (in response to dosten)Hi Daren ,
I have different question if you might help me. I following set up
Screen Shot
Question
The issue is that "person" which is defined at the process level and also being correctly mapped in the "Simple Task" and inside the "Business Rules" part the instance is available and it is not null
but when it comes down to the arrow path XOR it becomes null and I cannot return the correct flag based on the value set up by the Business rule .
I want to pass the expression like return person.getAdult() == true ; but as the Person is null it is not working.
It will be a great help if you can suggest some tips to trouble shoot this.. I am doing everything right I believe so ..but .. some how it is not coming up ..
-
8. Re: Hi ,unable to map variables in Human Task
dosten Dec 24, 2014 4:12 PM (in response to sanjay05222)Sanjay, hard to tell what is wrong. Try explicitly setting the process variable at the end of the "check person" script task. An example would be:
kcontext.setVariable("person", person);
-
9. Re: Hi ,unable to map variables in Human Task
sanjay05222 Dec 24, 2014 4:39 PM (in response to dosten)Yes that's what I have thought for but I am surprise it works fine for the Cascading Human Tasks but for the "Business Rule Task" it doesn't work the same way. ? is that by design or it is defect that was my main concern. - Thanks for responding though. it helped me to concur the thoughts with your suggestion.
If you get chance probably try the simple flow and test this functionality at your end. Because I feel that if I do the correct "Data Assignments" inside the "Business Rule Task" I expect that person object should get populated with the correct instance of the object as per the assignment and I don't have any other way to confirm this behavior. I believe swiderski.maciej videos didn't to any thing special and it worked for him I think there is definitly something wrong I am doing. I still feel that I should not do kcontext.setVariable. it should work out of the box. by setting the Data Assignments.
I believe he sees this discussion he might have some Idea about it.
Thanks
Sanjay Gautam
-
10. Re: Hi ,unable to map variables in Human Task
sanjay05222 Dec 24, 2014 5:14 PM (in response to dosten)I tried setting up via kcontext on the exit actions of the "Business Rule Task" but that doesnt seems to work either .
-
11. Re: Hi ,unable to map variables in Human Task
dosten Dec 30, 2014 10:23 AM (in response to sanjay05222)Unfortunately, I have never used business rule tasks so I am not sure how those behave.
-
12. Re: Hi ,unable to map variables in Human Task
sanjay05222 Dec 30, 2014 8:27 PM (in response to khirod_panda)Hi khirod panda
Please let me know if you were able to find out and were correctly able to map the input and output variables.
If you can tell which IDE set up you are using then it will be easy for me to replicate the issue.
I installed the eclipse kepler and the JBOSS Tools Kepler 4.1.2 Final version and I see the UI for the process diagrams are different as compare to your screen shot.
please share the information my screen shot looks like below.
-
13. Re: Hi ,unable to map variables in Human Task
khirod_panda Dec 30, 2014 8:43 PM (in response to sanjay05222)Hi Sanjay ,
I was not able to do that .
My Spec is :-
Jbos Developer studio 7.1( on top of eclipse) with JBPM plugin added
Please let me know if any more detail i can provide to help .
Thanks
-
14. Re: Hi ,unable to map variables in Human Task
sanjay05222 Dec 30, 2014 9:09 PM (in response to sanjay05222)I think i got it what needs to be done actually if you run install all it works fine. I think I didn't used that and hence it didn't installed modeler which is there in Ant Build.xml - Thanks