lib/openwfe/flowexpressionid.rb in openwferu-0.9.2 vs lib/openwfe/flowexpressionid.rb in openwferu-0.9.3
- old
+ new
@@ -47,21 +47,27 @@
# FlowExpressionId
#
class FlowExpressionId
attr_accessor \
- :owfe_version, \
- :engine_id, \
- :initial_engine_id, \
- :workflow_definition_url, \
- :workflow_definition_name, \
- :workflow_definition_revision, \
- :workflow_instance_id, \
- :expression_name, \
+ :owfe_version,
+ :engine_id,
+ :initial_engine_id,
+ :workflow_definition_url,
+ :workflow_definition_name,
+ :workflow_definition_revision,
+ :workflow_instance_id,
+ :expression_name,
:expression_id
#
+ # A shortcut for fei.workflow_instance_id.
+ # There's also fei.parent_wfid.
+ #
+ alias :wfid :workflow_instance_id
+
+ #
# overrides the classical to_s()
#
def to_s ()
return "(fei #{@owfe_version} #{@engine_id}/#{@initial_engine_id} #{@workflow_definition_url} #{@workflow_definition_name} #{@workflow_definition_revision} #{@workflow_instance_id} #{@expression_name} #{@expression_id})"
end
@@ -83,21 +89,11 @@
@expression_name == other.expression_name and
@expression_id == other.expression_id
end
def dup
- n = FlowExpressionId.new
- n.owfe_version = @owfe_version.dup
- n.engine_id = @engine_id.dup
- n.initial_engine_id = @initial_engine_id.dup
- n.workflow_definition_url = @workflow_definition_url.dup
- n.workflow_definition_name = @workflow_definition_name.dup
- n.workflow_definition_revision = @workflow_definition_revision.dup
- n.workflow_instance_id = @workflow_instance_id.dup
- n.expression_name = @expression_name.dup
- n.expression_id = @expression_id.dup
- return n
+ OpenWFE::fulldup(self)
end
alias eql? ==
alias to_debug_s to_s
@@ -114,9 +110,11 @@
i = workflow_instance_id.index(".")
return workflow_instance_id if not i
#return workflow_instance_id[0..i]
return workflow_instance_id[0..i-1]
end
+
+ alias :parent_wfid :parent_workflow_instance_id
#
# This class method parses a string into a FlowExpressionId instance
#
def FlowExpressionId.to_fei (string)