Class: Operaton::Bpm::Client::Topic::Impl::Dto::FetchAndLockRequestDto

Inherits:
Impl::RequestDto
  • Object
show all
Defined in:
lib/operaton/bpm/client/topic/impl/dto/fetch_and_lock_request_dto.rb

Overview

Mirrors org.operaton.bpm.client.topic.impl.dto.FetchAndLockRequestDto (annotated @JsonInclude(NON_NULL) in Java — nil fields are omitted).

Instance Attribute Summary collapse

Attributes inherited from Impl::RequestDto

#worker_id

Instance Method Summary collapse

Constructor Details

#initialize(worker_id, max_tasks, async_response_timeout, topics, use_priority = true, ordering_config = Task::OrderingConfig.empty) ⇒ FetchAndLockRequestDto

Returns a new instance of FetchAndLockRequestDto.



17
18
19
20
21
22
23
24
25
# File 'lib/operaton/bpm/client/topic/impl/dto/fetch_and_lock_request_dto.rb', line 17

def initialize(worker_id, max_tasks, async_response_timeout, topics,
               use_priority = true, ordering_config = Task::OrderingConfig.empty)
  super(worker_id)
  @max_tasks = max_tasks
  @use_priority = use_priority
  @async_response_timeout = async_response_timeout
  @topics = topics
  @sorting = ordering_config.to_sorting_dtos
end

Instance Attribute Details

#async_response_timeoutObject (readonly)

Returns the value of attribute async_response_timeout.



15
16
17
# File 'lib/operaton/bpm/client/topic/impl/dto/fetch_and_lock_request_dto.rb', line 15

def async_response_timeout
  @async_response_timeout
end

#max_tasksObject (readonly)

Returns the value of attribute max_tasks.



15
16
17
# File 'lib/operaton/bpm/client/topic/impl/dto/fetch_and_lock_request_dto.rb', line 15

def max_tasks
  @max_tasks
end

#sortingObject (readonly)

Returns the value of attribute sorting.



15
16
17
# File 'lib/operaton/bpm/client/topic/impl/dto/fetch_and_lock_request_dto.rb', line 15

def sorting
  @sorting
end

#topicsObject (readonly)

Returns the value of attribute topics.



15
16
17
# File 'lib/operaton/bpm/client/topic/impl/dto/fetch_and_lock_request_dto.rb', line 15

def topics
  @topics
end

Instance Method Details

#as_jsonObject



31
32
33
34
35
36
37
38
39
40
# File 'lib/operaton/bpm/client/topic/impl/dto/fetch_and_lock_request_dto.rb', line 31

def as_json
  json = super.merge(
    "maxTasks" => max_tasks,
    "usePriority" => use_priority?,
    "asyncResponseTimeout" => async_response_timeout,
    "topics" => topics.map(&:as_json),
    "sorting" => sorting.map(&:as_json)
  )
  json.compact
end

#use_priority?Boolean

Returns:

  • (Boolean)


27
28
29
# File 'lib/operaton/bpm/client/topic/impl/dto/fetch_and_lock_request_dto.rb', line 27

def use_priority?
  @use_priority
end