Class OpenWFE::ExpExpression
In: lib/openwfe/expressions/fe_misc.rb
Parent: RawExpression

Some kind of limited ‘eval’ expression.

Here is an usage example :

    class ExampleDef < OpenWFE::ProcessDefinition

        sequence do

            exp :name => "p0"
            exp :name => "sub0"

            exp :name => "sequence" do
                p0
                sub0
            end

            set :var => "a", :value => { "ref" => "p0" }
            exp :name => "participant", :variable_attributes => "a"
        end

        process_definition :name => "sub0" do
            _print "sub0"
        end
    end

This example is a bit static, but the point is that the ‘exp’ is extracting the real expression name (or participant or subprocess name) from its ‘name’ attribute.

The ‘eval’ expression is about evaluating a complete process definition branch, ‘exp’ is only about one node in the process definition.

Methods

Public Instance methods

[Source]

     # File lib/openwfe/expressions/fe_misc.rb, line 279
279:         def apply (workitem)
280: 
281:             @applied_workitem = workitem
282: 
283:             super
284:         end

Protected Instance methods

Evaluates the ‘name’ attribute, if it‘s not present or empty, will return the value for the ‘default’ attribute.

[Source]

     # File lib/openwfe/expressions/fe_misc.rb, line 292
292:             def expression_name
293: 
294:                 n = lookup_attribute(:name, @applied_workitem)
295: 
296:                 return lookup_attribute(:default, @applied_workitem) \
297:                     if (not n) or (n.strip == '')
298: 
299:                 n
300:             end

If the ‘attributes’ attribute is present, will return its value. Else, will simply return the attributes of the ‘exp’ expression itself (‘name’ and ‘default’ included).

[Source]

     # File lib/openwfe/expressions/fe_misc.rb, line 307
307:             def extract_attributes
308: 
309:                 att = lookup_vf_attribute @applied_workitem, :attributes
310:                     # will currently only work with an attribute hash
311:                     # whose keys are strings... symbols :(
312: 
313:                 att || @attributes
314:             end

[Source]

     # File lib/openwfe/expressions/fe_misc.rb, line 320
320:             def extract_children
321:                 @children
322:             end

[Source]

     # File lib/openwfe/expressions/fe_misc.rb, line 316
316:             def extract_descriptions
317:                 []
318:             end

[Source]

     # File lib/openwfe/expressions/fe_misc.rb, line 324
324:             def extract_parameters
325:                 []
326:             end

[Validate]