Catching intermediate conditional event (rest api)

234 views
Skip to first unread message

Сергей Марченко

unread,
Dec 9, 2015, 1:28:58 PM12/9/15
to jBPM Development
Hello. I would like to create conditional event and check object propery of this event in process.
For example:
conditional expression: Person( name == "Ivan" )

I do ksession.insert(new Person("Ivan")) and event executed (for local instances of process).
But now i need this functionality remotely. I want send this object (Person) to rest api and business process check object property (for example name) and do smth logic.
But ksession.insert is not supported in remote api.
Maybe I can do it another way?

Maciej Swiderski

unread,
Dec 10, 2015, 12:25:34 PM12/10/15
to Сергей Марченко, jBPM Development
Depending on your runtime strategy (except per request which is destoryed after each request) you could to following workaround:
- singleton 
- add new process instance that you can start with parameters that will use script task to insert the object into working memory - since it’s singleton ksession all processes will share the same ksession and thus it will trigger conditional event
- then start everytime you need to insert new facts new instance of that process

- per process instance 
- add to your process definition event sub process with signal start event and data mapping to set fact as process variable that then can be inserted into ksession as part of this event subprocess
- then signal your process instance to trigger that event sub process - make sure you pass the actual fact as event of the signal

with that you use processes to insert facts into working memory

Hope this helps
Maciej
--
You received this message because you are subscribed to the Google Groups "jBPM Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jbpm-developme...@googlegroups.com.
To post to this group, send email to jbpm-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jbpm-development/f6f752ce-15ba-4afb-bf6f-bae9f15802de%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Message has been deleted

Сергей Марченко

unread,
Dec 15, 2015, 4:57:47 PM12/15/15
to jBPM Development
Thank you very much. Everything works well =))
Reply all
Reply to author
Forward
0 new messages