lib/openwfe/flowexpressionid.rb in openwferu-0.9.11 vs lib/openwfe/flowexpressionid.rb in openwferu-0.9.12

- old
+ new

@@ -72,10 +72,12 @@ # A shortcut for fei.workflow_instance_id. # There's also fei.parent_wfid. # alias :wfid :workflow_instance_id alias :wfid= :workflow_instance_id= + alias :expid :expression_id + alias :expid= :expression_id= # # Overrides the classical to_s() # def to_s () @@ -105,19 +107,25 @@ end def == (other) return false if not other.kind_of?(FlowExpressionId) - @owfe_version == other.owfe_version and - @engine_id == other.engine_id and - @initial_engine_id == other.initial_engine_id and + #return self.to_s == other.to_s + # no perf gain + + @workflow_instance_id == other.workflow_instance_id and + @expression_id == other.expression_id and @workflow_definition_url == other.workflow_definition_url and - @workflow_definition_name == other.workflow_definition_name and @workflow_definition_revision == other.workflow_definition_revision and - @workflow_instance_id == other.workflow_instance_id and + @workflow_definition_name == other.workflow_definition_name and @expression_name == other.expression_name and - @expression_id == other.expression_id + @owfe_version == other.owfe_version and + @engine_id == other.engine_id and + @initial_engine_id == other.initial_engine_id + # + # Make sure to put on top of the 'and' the things that + # change the most... end # # Returns true if this other FlowExpressionId is nested within # this one. @@ -227,9 +235,16 @@ fei.expression_id = fei.expression_id[0..-2] \ if fei.expression_id[-1, 1] == ")" fei + end + + # + # An alias for to_fei(string) + # + def FlowExpressionId.from_s (string) + FlowExpressionId.to_fei(string) end end end