Class: StackMate::WaitConditionHandle
- Inherits:
-
Ruote::Participant
- Object
- Ruote::Participant
- StackMate::WaitConditionHandle
- 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
#create ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/stackmate/participants/common.rb', line 26 def create logger.debug "Entering #{participant_name} " workitem[participant_name] = {} wait_cond_base = ENV['WAIT_COND_URL_BASE']?ENV['WAIT_COND_URL_BASE']:'http://localhost:4567/' presigned_url = wait_cond_base + '/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 |
#delete ⇒ Object
38 39 40 41 42 43 44 45 46 47 |
# File 'lib/stackmate/participants/common.rb', line 38 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_workitem ⇒ Object
49 50 51 52 53 54 55 56 57 |
# File 'lib/stackmate/participants/common.rb', line 49 def on_workitem if workitem['params']['operation'] == 'create' create else #rollback / delete delete end reply end |