Re: [rules-users] [Drools Flow 5.1] Updating a process definition -> Proceed updates running processes

2011-05-27 Thread anton.litvinenko
Greg, your guess is correct! The process instance is in fact persisted in db
for the period waiting for response  in node 2.

Guys from dev-team, do you agree that this is a bug and should be filled in
Jira?

--
View this message in context: 
http://drools.46999.n3.nabble.com/Drools-Flow-5-1-Updating-a-process-definition-Proceed-updates-running-processes-tp2928103p2993612.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] [Drools Flow 5.1] Updating a process definition -> Proceed updates running processes

2011-05-25 Thread anton.litvinenko
I tried exactly that and my already running process continued with the
*updated* process version.

I have a process with 3 nodes: Action Node (writing to system.out) => Async
Work Item (makes request and then waits for async result - not blocking) =>
Action Node (writing to system.out)

So, I experimented like this:
1. started the process, saw first system.out, saw making request
2. updated the process to have a different system.out at last action node,
deployed it to Guvnor, waited for KnowledgeAgent to pick it up
3. sent response to the process at Async Work Item -> saw *new* system.out
at the last node.

Am i doing something wrong? Or have wrong expectations?

--
View this message in context: 
http://drools.46999.n3.nabble.com/Drools-Flow-5-1-Updating-a-process-definition-Proceed-updates-running-processes-tp2928103p2985817.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] [Drools Flow 5.1] persistence + spring + localTransaction

2011-05-25 Thread anton.litvinenko
Greg, were you able to achieve process persistence in other configurations?
(e.g. without spring?) 

I don't use drools-spring bean factories to instantiate KnowledgeAgent and
KnoweldgeBase (instead i created alternative factories) + the following JPA
definition and spring context

persistence.xml:

http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd
http://java.sun.com/xml/ns/persistence/orm
http://java.sun.com/xml/ns/persistence/orm_1_0.xsd";
 xmlns:orm="http://java.sun.com/xml/ns/persistence/orm";
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
 xmlns="http://java.sun.com/xml/ns/persistence";>


org.hibernate.ejb.HibernatePersistence
org.drools.persistence.session.SessionInfo
   
org.drools.persistence.processinstance.ProcessInstanceInfo
   
org.drools.persistence.processinstance.ProcessInstanceEventInfo
org.drools.persistence.processinstance.WorkItemInfo
   
org.drools.persistence.processinstance.variabletypes.VariableInstanceInfo
   
org.drools.persistence.processinstance.variabletypes.SerializablePersistedVariable
   
org.drools.persistence.processinstance.variabletypes.JPAPersistedVariable










ApplicationContext.xml:















This kinda works, but I have to start transaction manually before invoking
any method on Drools Flow. And of course if an exception happens during the
invocation then everything is rolled back (e.g. process with 3 steps and the
last step crashes then process state in database is not updated with 2 first
steps).

Is it possible to configure Drools Flow to start/commit transaction at
before/after process step?

--
View this message in context: 
http://drools.46999.n3.nabble.com/Drools-Flow-5-1-persistence-spring-localTransaction-tp2875263p2985689.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] [Drools Flow 5.1] Updating a process definition -> Proceed updates running processes

2011-05-25 Thread anton.litvinenko
Esteban, please explain if a process cannot be updated (and one has to deploy
a new process with a different id whenever he/she changes the process
definition), then what does the second part of the
http://downloads.jboss.com/drools/docs/5.1.1.34858.FINAL/drools-flow/html/ch04.html#d0e1514
mean?

Quoting the doc:
"By default, Drools Flow uses the proceed approach, meaning that multiple
versions of the same process can be deployed, but existing process instances
will simply continue executing based on the process definition that was used
when starting the process instance."

But if the id is different then, these are different processes and Drools
Flow simply doesn't know that they are same processes under different names.
So, the "proceed" behavior is met trivially - there is not even possible for
2 different versions of the same process to exist at the same time? Do I
understand correctly that for Drools Flow 2 processes are the same when it
they have the same id?

So, basically, if I use Guvnor and someone uploads a new version of the
process and compiles it, then my application automatically picks up the
updated version even for currently running processes (stopped at
asynchronous step) is that correct? And if I want existing processes to
continue then I need to use a different id for update process (and hence
re-configure the whole app to start processes based on new id) which kind of
a kills all the Guvnor idea.

It seems like I am not understanding something. I would be very thankful, if
someone could explain to me, what I am getting wrong.

Thanks!

--
View this message in context: 
http://drools.46999.n3.nabble.com/Drools-Flow-5-1-Updating-a-process-definition-Proceed-updates-running-processes-tp2928103p2985647.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] [Drools Flow 5.1] Updating a process definition -> Proceed updates running processes

2011-05-11 Thread anton.litvinenko
but definition of "Proceed" seems to contradict that:

"Proceed: The running process instance proceeds as normal, following the
process (definition) as it was defined when the process instance was
started. As a result, the already running instance will proceed as if the
process was never updated. New instances can be started using the updated
process."

I mean, if process definition has a different id then this is a different
process definition and every method that used to start some particular
process based on its id, now needs to be updated to start processes based on
new id -> kinda makes the whole idea pointles, doesn't it? 

And part about version really confuses me then -> it says that "you can use
the version parameter to show when a process is updated" which I interpret
that I can use version to tell Drools that these are two different versions
of process.

Seems like either I am dumb; documentation doesn't explain the real use case
of updating processes or this feature is not really thought through.

--
View this message in context: 
http://drools.46999.n3.nabble.com/Drools-Flow-5-1-Updating-a-process-definition-Proceed-updates-running-processes-tp2928103p2930258.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] [Drools Flow 5.1] Updating a process definition -> Proceed updates running processes

2011-05-11 Thread anton.litvinenko
Hi!

According to
http://downloads.jboss.com/drools/docs/5.1.1.34858.FINAL/drools-flow/html/ch04.html#d0e1514
Drools Flow is using "Proceed" strategy by default = already running
processes should continue using old process definitions and new processes
will be run according to updated process definition.

In reality it doesn't seem working this way: I am using persistent session
and I have a process with async step. So, whenever a process stops at this
step and I update the process definition in Guvnor (and build new package)
then process continues with the new definition (I've added simple Action
node with system out and change string that is written to system out).

I tried to use version parameter in process definition to distinguish
between old and new definitions, but it doesn't make any difference.

Could someone please comment on that?

--
View this message in context: 
http://drools.46999.n3.nabble.com/Drools-Flow-5-1-Updating-a-process-definition-Proceed-updates-running-processes-tp2928103p2928103.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] [Drools Flow 5.1] persistence + spring + localTransaction

2011-05-11 Thread anton.litvinenko
Nobody uses Drools Flow with Spring?

According to svn Mark Proctor should be aware why/how this localTransaction
flag is used. Mark could you please comment?

--
View this message in context: 
http://drools.46999.n3.nabble.com/Drools-Flow-5-1-persistence-spring-localTransaction-tp2875263p2928070.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] [Drools Flow 5.1] persistence + spring + localTransaction

2011-04-28 Thread anton.litvinenko
Hi!

I am quite new to Drools and Drools Flow - please let me know if I am asking
something obvious here :)

I've implemented my custom WorkItemHandlers that are aware of the
KnowledgeSession. Now, I am trying to enable persistence to flows using
drools-persistence-jpa and drools-spring. Ideally, I wanted drools to start
and end transactions, but I wasn't able to achieve that (this is the
problem) and I have start/end transactions manually before
starting/aborting/signaling a process (i.e. running a process is a single
transaction -> if exception happens no state is persisted).

Problem: DroolsSpringTransactionManager has a flag localTransaction which is
set to true whenever a new transaction is started and transaction is
committed only if this flag is set to true. Now, if inside workItemHandler I
invoke a method on knowledgeSession, then my call is being delegated to
SingleSessionCommandService and it tries to start a transaction, but it sees
that there is a transaction already running and sets localTransaction flag
to false -> transaction never gets committed.

Am I doing something wrong here?

Thanks in advance!
Anton

--
View this message in context: 
http://drools.46999.n3.nabble.com/Drools-Flow-5-1-persistence-spring-localTransaction-tp2875263p2875263.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users