[jboss-user] [jBPM] - jBPM 5.4 : Signal Event and VariableName

wishmaster7 do-not-reply at jboss.com
Wed Jan 30 10:25:13 EST 2013


wishmaster7 [https://community.jboss.org/people/wishmaster7] created the discussion

"jBPM 5.4 : Signal Event and VariableName"

To view the discussion, visit: https://community.jboss.org/message/795177#795177

--------------------------------------------------------------
Hi all,

I am a beginner with jBPM and I need some help with the signal event; all I have found in the documentation (and in the web chat) is something like :

VariableName: The name of the variable that will contain the data associated with this event (if any) when this event occurs.

And this doesn't help much...


So I have created a basic example with a start node, then a AND gateway which waits for the signal event. I'm working with jBPM REST webservices; first I call :

POST: http://localhost:8080/gwt-console-server/rs/process/definition/myProcess/new_instance

and in the json return, I get the process instance id (in this example: 57). Then I call :

POST: http://localhost:8080/gwt-console-server/rs/process/tokens/57/transition?signal=receiveInitData

and this pefectly triggers the signal event. But I want to pass parameters, and I think the "VariableName" of the signal event is suitable for that. So I have the "woId" variable, but its value is always null.



Here is, in my Java application, the code I use to call the POST webservice:

private String requestPostService() throws Exception {

String url = 
"http://localhost:8080/gwt-console-server/rs/process/tokens/57/transition?signal=receiveInitData";

    
    // here is my map with the parameter I want to pass to the jBPM process
    List<NameValuePair> formparams = new ArrayList<NameValuePair>();
    formparams.add(new BasicNameValuePair("woId", "testValue"));

        HttpPost httpPost = new HttpPost(url);
        UrlEncodedFormEntity entity = new UrlEncodedFormEntity(formparams, "UTF-8");
        httpPost.setEntity(entity);
        HttpClient httpClient = new DefaultHttpClient();
        HttpResponse response = httpClient.execute(httpPost);
   // the getRequestString() method is parsing the response

        return this.getRequestString(response);

    }


And in attachement, the process BPMN file.

I don't know what is missing; in the console, it's printing:

Init data...
null



"Init data" is the string called in "Init Data" task; null is the value of my variable.

Someone has an idea?
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/795177#795177]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20130130/ebba3c27/attachment-0001.html 


More information about the jboss-user mailing list