Module: Bumbleworks
- Extended by:
- Forwardable
- Defined in:
- lib/bumbleworks.rb,
lib/bumbleworks/task.rb,
lib/bumbleworks/ruote.rb,
lib/bumbleworks/support.rb,
lib/bumbleworks/version.rb,
lib/bumbleworks/tasks/base.rb,
lib/bumbleworks/hash_storage.rb,
lib/bumbleworks/tree_builder.rb,
lib/bumbleworks/configuration.rb,
lib/bumbleworks/simple_logger.rb,
lib/bumbleworks/storage_adapter.rb,
lib/bumbleworks/local_participant.rb,
lib/bumbleworks/process_definition.rb,
lib/bumbleworks/storage_participant.rb,
lib/bumbleworks/workitem_entity_storage.rb,
lib/bumbleworks/participant_registration.rb
Defined Under Namespace
Modules: LocalParticipant, Support, Tasks, WorkitemEntityStorage Classes: Configuration, HashStorage, InvalidEntity, InvalidSetting, ParticipantRegistration, ProcessDefinition, Ruote, SimpleLogger, StorageAdapter, StorageParticipant, Task, TreeBuilder, UndefinedSetting, UnsupportedMode
Constant Summary collapse
- VERSION =
"0.0.25"
Class Attribute Summary collapse
-
.env ⇒ Object
Returns the value of attribute env.
Class Method Summary collapse
-
.configuration ⇒ Object
Returns the global configuration, or initializes a new configuration object if it doesn’t exist yet.
-
.configure {|configuration| ... } ⇒ Object
Yields the global configuration to a block.
-
.configure! {|configuration| ... } ⇒ Object
Same as .configure, but clears all existing configuration settings first.
-
.launch!(process_definition_name, options = {}) ⇒ Object
Launches the process definition with the given process name, as long as that definition name is already registered with Bumbleworks.
-
.load_definitions!(options = {}) ⇒ Object
Registers all process_definitions in the configured definitions_directory with the Ruote engine.
-
.register_participants(&block) ⇒ Object
Accepts a block for registering participants.
-
.register_tasks(&block) ⇒ Object
Autoloads all files in the configured tasks_directory.
-
.reset! ⇒ Object
Resets Bumbleworks - clears configuration and setup variables, and also resets the dashboard.
Class Attribute Details
.env ⇒ Object
Returns the value of attribute env.
22 23 24 |
# File 'lib/bumbleworks.rb', line 22 def env @env end |
Class Method Details
.configuration ⇒ Object
Returns the global configuration, or initializes a new configuration object if it doesn’t exist yet. If initializing new config, also adds default storage adapters.
36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/bumbleworks.rb', line 36 def configuration @configuration ||= begin configuration = Bumbleworks::Configuration.new configuration.add_storage_adapter(Bumbleworks::HashStorage) if defined?(Bumbleworks::Redis::Adapter) && Bumbleworks::Redis::Adapter.auto_register? configuration.add_storage_adapter(Bumbleworks::Redis::Adapter) end if defined?(Bumbleworks::Sequel::Adapter) && Bumbleworks::Sequel::Adapter.auto_register? configuration.add_storage_adapter(Bumbleworks::Sequel::Adapter) end configuration end end |
.configure {|configuration| ... } ⇒ Object
Yields the global configuration to a block.
59 60 61 62 63 64 |
# File 'lib/bumbleworks.rb', line 59 def configure(&block) unless block raise ArgumentError.new("You tried to .configure without a block!") end yield configuration end |
.configure! {|configuration| ... } ⇒ Object
Same as .configure, but clears all existing configuration settings first.
71 72 73 74 |
# File 'lib/bumbleworks.rb', line 71 def configure!(&block) @configuration = nil configure(&block) end |
.launch!(process_definition_name, options = {}) ⇒ Object
Launches the process definition with the given process name, as long as that definition name is already registered with Bumbleworks. If options has an :entity key, attempts to extract the id and class name before sending it, so it can be properly stored in workitem fields (and re-instantiated later).
124 125 126 127 |
# File 'lib/bumbleworks.rb', line 124 def launch!(process_definition_name, = {}) () Bumbleworks::Ruote.launch(process_definition_name, ) end |
.load_definitions!(options = {}) ⇒ Object
Registers all process_definitions in the configured definitions_directory with the Ruote engine.
103 104 105 |
# File 'lib/bumbleworks.rb', line 103 def load_definitions!( = {}) Bumbleworks::ProcessDefinition.create_all_from_directory!(definitions_directory, ) end |
.register_participants(&block) ⇒ Object
Accepts a block for registering participants. Note that a ‘catchall Ruote::StorageParticipant’ is always added to the end of the list (unless it is defined in the block).
87 88 89 90 |
# File 'lib/bumbleworks.rb', line 87 def register_participants(&block) Bumbleworks::ParticipantRegistration.autoload_all Bumbleworks::Ruote.register_participants(&block) end |
.register_tasks(&block) ⇒ Object
Autoloads all files in the configured tasks_directory.
95 96 97 |
# File 'lib/bumbleworks.rb', line 95 def register_tasks(&block) Bumbleworks::Task.autoload_all end |
.reset! ⇒ Object
Resets Bumbleworks - clears configuration and setup variables, and also resets the dashboard.
111 112 113 114 115 |
# File 'lib/bumbleworks.rb', line 111 def reset! @configuration = nil @participant_block = nil Bumbleworks::Ruote.reset! end |