[rules-users] problems with variables in drools-flow

Ševčík Martin MaSevcik at cpoj.cz
Thu Jul 2 04:40:37 EDT 2009


 

I have a simple process with action and one human task. 

 

 

 

 When I'm starting a process, I add a variable this way:

 

Map<String,Object> data = new HashMap<String,Object>();

data.put("data3", "this is data3");

ProcessInstance pi = ksession.startProcess("com.sample.ruleflow",data);

 

Another data I put in variable properties of the ruleflow, and called it data1.

 

 

 

Third variable I added in action this way:

 

((org.drools.process.instance.context.variable.VariableScopeInstance) (context.getProcessInstance().getContextInstance(org.drools.process.core.context.variable.VariableScope.VARIABLE_SCOPE))).setVariable("data2", "this is data2");

 

But when I'm trying to map this variables in human task, only data1 is visible, the other end up with :

 

Could not find variable scope for variable data2

when trying to execute Work Item Human Task

Continuing without setting parameter.

Could not find variable scope for variable data3

when trying to execute Work Item Human Task

Continuing without setting parameter.

 

Could you please help me?

 

And also, how can I get this data in human task?

 

I can get a task summary this way:

 

BlockingTaskSummaryResponseHandler responseHandler = new BlockingTaskSummaryResponseHandler();       

client1.getTasksAssignedAsPotentialOwner("martin", "en-UK", responseHandler);

List<TaskSummary> list = responseHandler.getResults();

 

And then a task this way:

 

BlockingGetTaskResponseHandler rh2 = new BlockingGetTaskResponseHandler();

client1.getTask(task.getId(), rh2);

Task task2 = rh2.getTask();

 

But how can i get object data1?

 

 

Thank you.

 

Martin

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20090702/e3174289/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/png
Size: 4093 bytes
Desc: image001.png
Url : http://lists.jboss.org/pipermail/rules-users/attachments/20090702/e3174289/attachment.png 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/png
Size: 7671 bytes
Desc: image002.png
Url : http://lists.jboss.org/pipermail/rules-users/attachments/20090702/e3174289/attachment-0001.png 


More information about the rules-users mailing list