There is no direct link from a child process instance to its parent (as
in general it might be possible that the sub process instance is
independent and that the parent process is either not interested in when
it completes or is no longer active).
But you should be able to retrieve the sub process instance id from the
SubProcessNodeInstance in the master process on the afterNodeTriggered
and before/afterNodeLeft events. This is not an object reference but
you can simply query the engine as the process instance will be in the
"cache" of process instances executed by the engine.
There might be other ways to make the sub process instance aware of it's
parent process, like passing the parent process instance id as a process
variable or as meta-data to the sub process instance (although this is
not part of the persisted state at the moment).
Kris
Burkhard Vogel wrote:
Looking into the to me known possibilities to hook up against the
working memory without really needing to extend core functionality, I
reckon my best shot is the
org.drools.event.process.ProcessEventListener. Unfortunately I can't
seem to find an event that holds information about the new or
terminating Sub-Process and the associated parent process. I looked
into the beforeNodeTriggered, afterNodeTriggered, BeforeNodeLeft,
afterNodeLeft, beforeProcessStarted, afterProcessStarted events but no
dice.
events in order of triggering
master process - beforeProcessStarted: no information
subProcessNode - beforeNodeTriggered: subProcessNode has neither sub
process name nor subProcessID available
subProcess - beforeProcessStarted: has the sub-Processname/id but no
reference to the parent process
subProcess - afterProcessStarted: has the sub-Processname/id but
reference in the external event listener?
subProcessNode - afterNodeTriggered: external event listener has the
instanceId of the child process but no object reference, so I'd need
to query the runtime?
master process - afterProcessStarted: external event listener has the
instanceId of the child process but no object reference, so I'd need
to query the runtime?
Anyone has an idea how I'd be able no indicate my users whats the
current state of his process if its within a sub-process instance?
Regards,
Burkhard
On 11/08/2011 13:28, Mauricio Salatino wrote:
> sure.. if you extend/configure the bam module to store that
> information you will be able to do all the queries that you need to
> find all those relationships.
> Don't try to do that queries to the runtime tables that are optimized
> and store binary data.
> Try also to avoid loading the process instance to do that kind of
> queries that can be easily externalized into another database or data
> structure that is more suited to answer those queries.
>
> Cheers
>
> On Thu, Aug 11, 2011 at 2:46 PM, Burkhard Vogel
> <Burkhard.Vogel(a)modinter.com.ec
> <mailto:Burkhard.Vogel@modinter.com.ec>> wrote:
>
> Hi,
> I checked my process instance info table and all states are in 1
> - what would be a condition that this changes to 2 (suspended) or
> 3 (ended) as currently all ended instances get deleted - is there
> a configuration option to accumulate these in a history table?
>
> Related to this - the only way to drill down from an process
> instance to the bottom most sub process instances current task is
> by loading it into the knowledge session and manually check if
> the node implements a subprocessnode instance and load that sub
> process instance and so forth until I get the last node which
> hasn't a node log with type 1? Would there be a way to query from
> the process/node logs the current sub-process and current node?
>
> To rephrase: I have the requirement to show in which state a
> current process is - which with the current console tools will
> only go as far as the parent flows current node - but that are
> almost always sub-processes, so what I'd need is a way to build a
> query (or a set of queries) that would reflect the current
> process instance hierarchy and the current bottom most process/node.
> I CAN do this by reading all current instances of a given parent
> task and afterwards do the individual drill-down until I reach
> the bottom most sub task - but this is desperately slow for
> thousands of instances, so I'm looking for a DB select as I
> reckon all the info is in the audit tables.
>
> Best regards,
> Burkhard
> --
>
> Saludos cordiales,
>
> *Burkhard Vogel*
> *Lead Strategic Development*
>
>
> modinter
> *Centre of Sales & Support • Quito, Ecuador*
>
> Leonidas Plaza N24-318 y Baquerizo Moreno
> Edificio Plaza 246
> Phone: +593 2 2237393 ext 7300
> <tel:%2B593%202%202237393%20ext%207300>
>
> Mobile: +593 9 5771800 <tel:%2B593%209%205771800>
> E-mail: burkhard.vogel(a)modinter.com.ec
> <mailto:burkhard.vogel@modinter.com.ec>
>
> *www.modinter.com.ec* <
http://www.modinter.com.ec/>
>
> The information in this e-mail and any attachments is
> confidential and is intended for the addressee only and may
> contain confidential, proprietary or legally privileged
> information. If you are not the intended recipient, please delete
> this message and any attachments and advise the sender by return
> e-mail. Unless otherwise stated, any pricing or deliver
> information given in this message is indicative only, is subject
> to change and to formal communication.
> FISA GROUP and each or any of its operating companies reserve the
> right to monitor all e-mail communication through its networks.
>
>
> _______________________________________________
> jbpm-dev mailing list
> jbpm-dev(a)lists.jboss.org <mailto:jbpm-dev@lists.jboss.org>
>
https://lists.jboss.org/mailman/listinfo/jbpm-dev
>
>
>
>
> --
> - CTO @
http://www.plugtree.com
> - MyJourney @
http://salaboy.wordpress.com
> - Co-Founder @
http://www.jbug.com.ar
>
> - Salatino "Salaboy" Mauricio -
--
Saludos cordiales,
*Burkhard Vogel*
*Lead Strategic Development*
modinter
*Centre of Sales & Support • Quito, Ecuador*
Leonidas Plaza N24-318 y Baquerizo Moreno
Edificio Plaza 246
Phone: +593 2 2237393 ext 7300
Mobile: +593 9 5771800
E-mail: burkhard.vogel(a)modinter.com.ec
<mailto:burkhard.vogel@modinter.com.ec>
*www.modinter.com.ec* <
http://www.modinter.com.ec/>
The information in this e-mail and any attachments is confidential and
is intended for the addressee only and may contain confidential,
proprietary or legally privileged information. If you are not the
intended recipient, please delete this message and any attachments and
advise the sender by return e-mail. Unless otherwise stated, any
pricing or deliver information given in this message is indicative
only, is subject to change and to formal communication.
FISA GROUP and each or any of its operating companies reserve the
right to monitor all e-mail communication through its networks.
------------------------------------------------------------------------
_______________________________________________
jbpm-dev mailing list
jbpm-dev(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jbpm-dev