How to use CAMUNDA Process Variables? How to notate them at first hand?

1,364 views
Skip to first unread message

Dieter Rueffler

unread,
Jul 26, 2015, 2:28:45 PM7/26/15
to camunda BPM users

Hi dear Community,


I try to develope the following camunda BPMN driven process:



This is (1) Polling Mailserver; (2) Receiving Resultset; (3) Processing Result Set Mail by Mail


I was able to get a propper resultset with the help of some Java (see last 3 pics)


I learned, that I can use a serialized service task to handle each single mail from a result set which is an array or a collection of mails.

I am required to make the result set available as CAMUNDA process variable.

I am not able to see or understand how or where to notate a CAMUNDA process variable.

I expect that it should be possible to notate a CAMUNDA process variable pretty close to the BPMN-model - at least inside "Properties".


At least I would be happy if it would be "somehow" and "recognizeable" possible - or some where hidden in java source code.


I am desperately seeking for a "manual" or some other kind of doku or a "speaking" example".


Regards, Dieter Rüffler



Daniel Meyer

unread,
Jul 27, 2015, 3:12:17 AM7/27/15
to camunda-...@googlegroups.com
Hi Dieter,

in Camunda you do not have to declare the variables sowewhere. You can
rather get and set then in your delegation code (Java or Scripts such as
groovy.)

Having said that, you can also declare your variables in BPMN Xml using
I/O mappings:
http://docs.camunda.org/7.3/guides/user-guide/#process-engine-process-variables-inputoutput-variable-mapping

Regards,
Daniel Meyer

--
Camunda Technical Lead
Blog: http://blog.camunda.org/
Twitter: @meyerdan

Dieter Rueffler

unread,
Jul 27, 2015, 6:54:15 PM7/27/15
to camunda BPM users, daniel...@camunda.com
Dear Daniel,

I used the process variable "newMails" in "Process Mail Item" as set in "Poll Mailserver":

public void execute(DelegateExecution execution) throws Exception {
MailContent[] newMails = this.getMailFromGmail();
execution.setVariable("newMails", newMails);
}

After start I found in the console the following message: 

<terminated>Launcher [Java Application]
<terminated, exit value: 0>C:\Program Files (x86)\Java\jdk1.8.0_45\bin\javaw.exe (28.07.2015 00:14:37)


Is this an error message or is it a regular termination?

Checking my source-inbox-mailfolder at gmail: Reading mails was successfull.
Checking my destination-inbox-mailfolder: No forwarding took place.  :-(

So there must be an error.
It would be nice to receive more debugging support from CAMUNDA... ...right now I am just guessing...
Question: How to do debugging?

What was wrong? 

Did I deliver a propper input to "Process Mail Item" with " newMails"?
Did an internal error in "Poll Mailserver" occured?




Is there an error with the condition at the non-Default flow?  #[false]  (Is it possible to use "false", is the syntax correct?)
Can CAMUNDA handle "Default flows"? 


A tutorial showing how to use Iteration would be nice.


Regards, Dieter 


Reply all
Reply to author
Forward
0 new messages