[jboss-user] [jBPM] - Re: Confusion between RuntimeManager and new Kie API in jBPM 6

2013-08-08 Thread Serge Huber
Serge Huber [https://community.jboss.org/people/bhillou] created the discussion

"Re: Confusion between RuntimeManager and new Kie API in jBPM 6"

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

--
Hello Maciej,

Thanks a lot, again your answer was very detailed and helpful. 

Best regards,
  Serge Huber.
--

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

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

___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user

[jboss-user] [jBPM] - Re: Confusion between RuntimeManager and new Kie API in jBPM 6

2013-08-06 Thread Maciej Swiderski
Maciej Swiderski [https://community.jboss.org/people/swiderski.maciej] created 
the discussion

"Re: Confusion between RuntimeManager and new Kie API in jBPM 6"

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

--
> Serge Huber wrote:
> 
> Thanks a lot for your answer, it helps clarify things a bit. Now I have a few 
> more questions. You talk about setting up a module that aggregates all 
> dependencies, but as I'm dealing with OSGi modules, I cannot know in advance 
> which modules will be deployed or not. Isn't there a way to do this 
> dynamically ?
What I meant is if you have dependent modules they should be aggregated into 
single one that will have all those modules defined as dependencies so there 
will be single unit of deployment that will have access to all required classes 
and assets. And yes, you can do it dynamically where you'll get one to one 
relationship between RuntimeManager and KieContainer. You can create 
RuntimeManagers (and then close) them on demand - meaning it is completely 
dynamic. That's the same way jbpm console does it, allows you at any time to 
deploy or undeploy units (kjars).


> Serge Huber wrote:
> 
> Also, if I understand you correctly, once I have the KieContainer with all 
> the dependencies, I should use that to initialize the RuntimeManager ? Do I 
> use the RuntimeEnvironmentBuilder to do that ? Any example you could provide 
> would be really great. 
Yes, best way is to use RuntimeEnvironmentBuilder as it allows you to configure 
all pieces in quite simple way. There are some helpers in RuntimeManager that 
helps to set it up. Take a look at:
 
https://github.com/droolsjbpm/jbpm/blob/master/jbpm-runtime-manager/src/main/java/org/jbpm/runtime/manager/impl/KModuleRegisterableItemsFactory.java
 KModuleRegisterableItemsFactory  this shall be used to setup KieSessions by 
RuntimeManager when RuntimeEngine is created. It uses kmodule.xml definitions 
to find the right configuration.
In general what you would need to do is:
1. create default RuntimeEnvironment using RuntimeEnvironmentBuilder
2. set KModuleRegisterableItemsFactory as registerableItemsFactory on builder
3. set KieBase taken from KieContainer on builder
4. set Clasloader taken from KieContainer on builder
5. most likely set EntityManagerFactory on builder otherwise it will create 
it's own
6. based on your user and group management set proper UserGroupCallback on 
builder
That should give you complete environment for most of the cases.

I'll be working on examples in upcoming week so hopefully that will give more 
insight into details.


> Serge Huber wrote:
> 
> I must say that I'm integrating both the BPM and the Rules part, and my OSGi 
> modules contain both. I'm actually in the process of upgrading from jBPM 4.4 
> all this codebase so I'm struggling a bit in making sure I'm using the new 
> APIs correctly, as I want to avoid using stuff that might get deprecated (as 
> it seems that some of the jBPM 5 code will be).
Completely understand that, due to the amount of work for 6 we did not have 
time for documentation and examples but soon these will start coming in which 
shall make the transition from previous versions easier. Feel free to post 
questions here so we can make sure code is written in the best way on both ends 

HTH
--

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

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

___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user

[jboss-user] [jBPM] - Re: Confusion between RuntimeManager and new Kie API in jBPM 6

2013-08-06 Thread Serge Huber
Serge Huber [https://community.jboss.org/people/bhillou] created the discussion

"Re: Confusion between RuntimeManager and new Kie API in jBPM 6"

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

--
Hello Maciej, 

Thanks a lot for your answer, it helps clarify things a bit. Now I have a few 
more questions. You talk about setting up a module that aggregates all 
dependencies, but as I'm dealing with OSGi modules, I cannot know in advance 
which modules will be deployed or not. Isn't there a way to do this dynamically 
?

Also, if I understand you correctly, once I have the KieContainer with all the 
dependencies, I should use that to initialize the RuntimeManager ? Do I use the 
RuntimeEnvironmentBuilder to do that ? Any example you could provide would be 
really great. 

I must say that I'm integrating both the BPM and the Rules part, and my OSGi 
modules contain both. I'm actually in the process of upgrading from jBPM 4.4 
all this codebase so I'm struggling a bit in making sure I'm using the new APIs 
correctly, as I want to avoid using stuff that might get deprecated (as it 
seems that some of the jBPM 5 code will be).

Best regards,
  Serge Huber.
--

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

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

___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user

[jboss-user] [jBPM] - Re: Confusion between RuntimeManager and new Kie API in jBPM 6

2013-08-05 Thread Maciej Swiderski
Maciej Swiderski [https://community.jboss.org/people/swiderski.maciej] created 
the discussion

"Re: Confusion between RuntimeManager and new Kie API in jBPM 6"

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

--
RuntimeManager is recommended way to use when processes are involved, for rules 
itself you don't need RuntimeManager as it's tailored for ease of management in 
BPM world. When it comes to multiple modules I would say that best would be to 
have top level module that aggregates all dependencies to other modules and 
then build up KieContainer for it. Once KieContainer is ready it can be used to 
get important parts of it:
* KieBase
* KieSession model
These two can be consumed by RuntimeManager and the RuntimeEnvironment to 
provide flexible execution environment. This is the approach that 
jbpm-kie-services deliver and are fully CDI based.

There has been some work done around RuntimeManager for spring too so might be 
something to look at. As you already mentioned there is not much documentation 
yet but soon it will start coming in, meanwhile take a look at kie-spring and 
kie-aries-blueprint modules of  
https://github.com/droolsjbpm/droolsjbpm-integration droolsjbpm-integration. 
Maybe it will bring you something useful if not feel free to open jira for 
improvements you think are needed.

HTH
--

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

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

___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user