Class: RTM::TMQL::TMQL4JEngine

Inherits:
Engine
  • Object
show all
Defined in:
lib/rtm/tmql/tmql4j.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Engine

create

Constructor Details

#initialize(params) ⇒ TMQL4JEngine

Returns a new instance of TMQL4JEngine.



6
7
8
9
10
11
12
# File 'lib/rtm/tmql/tmql4j.rb', line 6

def initialize(params)
  super
  @topic_maps = []
  set_topic_map

  @new_tms = @topic_maps.first.engine.tmsf.newTopicMapSystem
end

Instance Attribute Details

#topic_mapsObject

Returns the value of attribute topic_maps.



4
5
6
# File 'lib/rtm/tmql/tmql4j.rb', line 4

def topic_maps
  @topic_maps
end

Instance Method Details

#enable_materialize_meta_model(materialize) ⇒ Object



30
31
32
# File 'lib/rtm/tmql/tmql4j.rb', line 30

def enable_materialize_meta_model(materialize)
  properties.enableMaterializeMetaModel(materialize)
end

#enable_updates(enabled) ⇒ Object



34
35
36
# File 'lib/rtm/tmql/tmql4j.rb', line 34

def enable_updates(enabled)
  properties.enableLanguageExtensionTmqlUl(enabled)
end

#execute(query) ⇒ Object



38
39
40
41
# File 'lib/rtm/tmql/tmql4j.rb', line 38

def execute(query)
  q = runtime.run(query)
  q.results
end

#propertiesObject



26
27
28
# File 'lib/rtm/tmql/tmql4j.rb', line 26

def properties
  runtime.properties
end

#runtimeObject



22
23
24
# File 'lib/rtm/tmql/tmql4j.rb', line 22

def runtime
  @runtime ||= Java::DeTopicmapslabTmql4jCommonCoreProcess::TMQLRuntimeFactory.newFactory.newRuntime(@new_tms, @topic_maps)
end

#set_topic_mapObject



14
15
16
17
18
19
20
# File 'lib/rtm/tmql/tmql4j.rb', line 14

def set_topic_map
  if construct = @params[:construct]
    @topic_maps << construct.topic_map || construct # because tm.topic_map is nil
  elsif topic_map = @params[:topic_map]
    @topic_maps << topic_map
  end
end