subProcess-Id and variables

22 views
Skip to first unread message

Klaus Schmidtmamn

unread,
Jun 7, 2012, 12:10:43 PM6/7/12
to ruote
Hello John,

it's me again! Is there a simple way, to get the sub-process-id and
all subprocess-variables by a given Process-Instance-ID within a ruby
class (e.g. my Workflow-Controller)?

Thank You and Greetings

Klaus

John Mettraux

unread,
Jun 7, 2012, 2:51:11 PM6/7/12
to openwfe...@googlegroups.com

On Thu, Jun 07, 2012 at 09:10:43AM -0700, Klaus Schmidtmamn wrote:
>
> it's me again! Is there a simple way, to get the sub-process-id and
> all subprocess-variables by a given Process-Instance-ID within a ruby
> class (e.g. my Workflow-Controller)?

Hello Klaus,

a process instance id (wfid) points to a process instance, it doesn't point
to a subprocess, so it's not possible.

If you're interested in process variables and assuming you know the process
id (wfid):

---8<---
ps = $ruote_dashboard.ps(wfid)

p ps.variables
# print variables at the root [expression] of the process
p ps.all_variables
# print variables found in all expressions of the process
p ps.expressions.collect { |e| e.fei.to_storage_id }
# print list of (string representations of) expressions
--->8---

Here is a list of the methods supported by ProcessStatus (whose instance are
returned by Ruote::Dashboard#ps(wfid)

def root_expressions
def root_expression_for(fei)
def variables
def all_variables
def tags
def all_tags
def past_tags
def wfid
def definition_name
def definition_revision
def position
def leaves
def root_workitem
def workitems
def last_active
def original_tree
def launched_time
def to_s
def hinspect(indent, h)
def inspect
def to_dot(opts={})
def to_h
def current_tree

I hope this will help anyway.


Best regards,

--
John Mettraux - http://lambda.io/jmettraux

Reply all
Reply to author
Forward
0 new messages