Class: OpenWFE::InMemoryExpressionStorage

Inherits:
Hash
  • Object
show all
Includes:
ExpressionStorageBase, OwfeServiceLocator, ServiceMixin
Defined in:
lib/openwfe/expool/expstorage.rb

Overview

Memory consuming in-memory storage. No memory limit, puts everything in a Hash

Instance Attribute Summary

Attributes included from ServiceMixin

#service_name

Attributes included from Contextual

#application_context

Instance Method Summary collapse

Methods included from ExpressionStorageBase

#class_accepted?, #does_match?, #observe_expool, #to_s

Methods included from OwfeServiceLocator

#get_engine, #get_error_journal, #get_expool, #get_expression_map, #get_expression_pool, #get_expression_storage, #get_expression_storages, #get_journal, #get_participant_map, #get_scheduler, #get_wfid_generator

Methods included from ServiceMixin

#service_init, #stop

Methods included from Contextual

#get_work_directory, #init_service, #lookup

Methods included from Logging

#ldebug, #ldebug_callstack, #lerror, #lfatal, #linfo, #llog, #lunknown, #lwarn

Constructor Details

#initialize(service_name, application_context) ⇒ InMemoryExpressionStorage

Returns a new instance of InMemoryExpressionStorage.



311
312
313
314
315
316
# File 'lib/openwfe/expool/expstorage.rb', line 311

def initialize (service_name, application_context)

    service_init service_name, application_context

    observe_expool
end

Instance Method Details

#fetch_root(wfid) ⇒ Object

Attempts at fetching the root expression of a given process instance.



394
395
396
397
398
399
# File 'lib/openwfe/expool/expstorage.rb', line 394

def fetch_root (wfid)

    find_expressions(
        :wfid => wfid, 
        :include_classes => DefineExpression)[0]
end

#find_expressions(options = {}) ⇒ Object

Finds expressions matching the given criteria (returns a list of expressions).

This methods is called by the expression pool, it’s thus not very “public” (not used directly by integrators, who should just focus on the methods provided by the Engine).

:wfid

will list only one process, :wfid => '20071208-gipijiwozo'

:parent_wfid

will list only one process, and its subprocesses, :parent_wfid => '20071208-gipijiwozo'

:consider_subprocesses

if true, “process-definition” expressions of subprocesses will be returned as well.

:wfid_prefix

allows your to query for specific workflow instance id prefixes. for example : :wfid_prefix => "200712" for the processes started in December.

:include_classes

excepts a class or an array of classes, only instances of these classes will be returned. Parent classes or mixins can be given. :includes_classes => OpenWFE::SequenceExpression

:exclude_classes

works as expected.

:wfname

will return only the expressions who belongs to the given workflow [name].

:wfrevision

usued in conjuction with :wfname, returns only the expressions with a given workflow revision.

:applied

if this option is set to true, will only return the expressions that have been applied (exp.apply_time != nil).



383
384
385
386
387
388
# File 'lib/openwfe/expool/expstorage.rb', line 383

def find_expressions (options={})

    values.find_all do |fexp|
        does_match? options, fexp
    end
end