java - Use variable in activiti -


i playing around vaadin , activity, , wondering how use variable, in vaadin code, in activiti script. example vaadin code following

textfield field = new textfield("enter name: "); button button = new button("click me: "); button.addclicklistener(new button.clicklistener() {      @override     public void buttonclick(clickevent event) {          processengine processengine = processengines.getdefaultprocessengine();           repositoryservice repositoryservice = processengine.getrepositoryservice();         repositoryservice.createdeployment()             .addclasspathresource("hello_world.bpmn20.xml")             .deploy();          hashmap<string, object> v = new hashmap<string, object> ();         v.put("name", field.getvalue());          runtimeservice runtimeservice = processengine.getruntimeservice();         runtimeservice.startprocessinstancebykey("myprocess", v);        } }); 

and groovy script in activiti

system.out.println("hello " + v); 

i tried use hashmap script still not recognize variable. how use code variables in activiti script?

it looks you're setting variable called name

    v.put("name", field.getvalue()); 

but printing variable called v

system.out.println("hello " + v); 

if change (making bit more groovy in process)

println "hello $name" 

it should work!


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -