Class: StackMate::WaitConditionHandle

Inherits:
Ruote::Participant
  • Object
show all
Includes:
Logging
Defined in:
lib/stackmate/participants/common.rb

Overview

class ParamHandle < Ruote::Participant

include Logging
def on_workitem
  logger.debug "Setting resolved parameter #{participant_name}"
  workitem['ResolvedNames'][participant_name] = workitem['']
end

end

Instance Method Summary collapse

Methods included from Logging

configure_logger_for, #logger, logger_for

Instance Method Details

#createObject



25
26
27
28
29
30
31
32
33
34
# File 'lib/stackmate/participants/common.rb', line 25

def create
  logger.debug "Entering #{participant_name} "
  workitem[participant_name] = {}
  presigned_url = 'http://localhost:4567/waitcondition/' + workitem.fei.wfid + '/' + participant_name
  workitem.fields['ResolvedNames'][participant_name] = presigned_url
  logger.info "Your pre-signed URL is: #{presigned_url} "
  logger.info "Try: \ncurl -X PUT --data 'foo' #{presigned_url}"
  WaitCondition.create_handle(participant_name, presigned_url)
  workitem[participant_name][:physical_id] = presigned_url
end

#deleteObject



36
37
38
39
40
41
42
43
44
45
# File 'lib/stackmate/participants/common.rb', line 36

def delete
  #p workitem
  logger.info "In delete #{participant_name}"
  return nil if !workitem[participant_name]
  physical_id = workitem[participant_name][:physical_id]
  if physical_id
    workitem[participant_name] = {}
    WaitCondition.delete_handle(participant_name)
  end
end

#on_workitemObject



47
48
49
50
51
52
53
54
55
# File 'lib/stackmate/participants/common.rb', line 47

def on_workitem
  if workitem['params']['operation'] == 'create'
    create
  else
    #rollback / delete
    delete
  end
  reply
end