lib/ruote/engine/process_error.rb in ruote-2.1.11 vs lib/ruote/engine/process_error.rb in ruote-2.2.0
- old
+ new
@@ -1,7 +1,7 @@
#--
-# Copyright (c) 2005-2010, John Mettraux, jmettraux@gmail.com
+# Copyright (c) 2005-2011, John Mettraux, jmettraux@gmail.com
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@@ -28,11 +28,11 @@
#
# Encapsulating all the information about an error in a process instance.
#
class ProcessError
- def initialize (h)
+ def initialize(h)
@h = h
end
def message
@h['message']
@@ -63,11 +63,11 @@
end
# A shortcut for modifying the tree of an expression when it has had
# an error upon being applied.
#
- def tree= (t)
+ def tree=(t)
@h['msg']['tree'] = t
end
def to_h
@h
@@ -81,21 +81,21 @@
end
# Exposes the workitem fields directly.
#
def fields
- @h['msg']['workitem']['fields']
+ @h['msg']['workitem'] && @h['msg']['workitem']['fields']
end
# Returns an instance of Ruote::Workitem
#
def workitem
Ruote::Workitem.new(msg['workitem'])
end
protected
- def to_dot (opts)
+ def to_dot(opts)
i = fei.to_storage_id
label = "error : #{message.gsub(/"/, "'")}"
[