Class: Operaton::Bpm::Client::Variable::Impl::Value::DeferredFileValueImpl

Inherits:
Engine::Variable::FileValue show all
Includes:
Value::DeferredFileValue
Defined in:
lib/operaton/bpm/client/variable/impl/value/deferred_file_value_impl.rb

Overview

Mirrors org.operaton.bpm.client.variable.impl.value.DeferredFileValueImpl

Instance Attribute Summary collapse

Attributes inherited from Engine::Variable::FileValue

#encoding, #filename, #mime_type

Attributes inherited from Engine::Variable::TypedValue

#is_transient, #type

Instance Method Summary collapse

Methods inherited from Engine::Variable::FileValue

#byte_array, #set_value

Methods inherited from Engine::Variable::TypedValue

#transient?

Constructor Details

#initialize(filename, engine_client) ⇒ DeferredFileValueImpl

Returns a new instance of DeferredFileValueImpl.



20
21
22
23
24
# File 'lib/operaton/bpm/client/variable/impl/value/deferred_file_value_impl.rb', line 20

def initialize(filename, engine_client)
  super(filename)
  @engine_client = engine_client
  @is_loaded = false
end

Instance Attribute Details

#execution_idObject

Returns the value of attribute execution_id.



18
19
20
# File 'lib/operaton/bpm/client/variable/impl/value/deferred_file_value_impl.rb', line 18

def execution_id
  @execution_id
end

#variable_nameObject

Returns the value of attribute variable_name.



18
19
20
# File 'lib/operaton/bpm/client/variable/impl/value/deferred_file_value_impl.rb', line 18

def variable_name
  @variable_name
end

Instance Method Details

#loaded?Boolean

Returns:

  • (Boolean)


26
27
28
# File 'lib/operaton/bpm/client/variable/impl/value/deferred_file_value_impl.rb', line 26

def loaded?
  @is_loaded
end

#to_sObject



36
37
38
39
# File 'lib/operaton/bpm/client/variable/impl/value/deferred_file_value_impl.rb', line 36

def to_s
  "DeferredFileValueImpl [mimeType=#{mime_type}, filename=#{filename}, " \
    "type=#{type}, isTransient=#{transient?}, isLoaded=#{loaded?}]"
end

#valueObject

Returns the file content, fetching it from the engine on first access.



31
32
33
34
# File 'lib/operaton/bpm/client/variable/impl/value/deferred_file_value_impl.rb', line 31

def value
  load_content unless loaded?
  super
end