03-12-2018 05:33 AM
I am getting the error
Cannot cast MyScript_372107627 to MyScript_372107627
during script execution, my script looks like below,
class MyScript
# Import the interface required by the Script snap.
include com.snaplogic.scripting.language.ScriptHook
attr_reader :log, :input, :output, :error
def initialize(log, input, output, error)
@log = log
@input = input
@output = output
@error = error
end
# The "execute()" method is called once when the pipeline is started
# and allowed to process its inputs or just send data to its outputs.
def execute()
while input.hasNext() do
begin
# Read the next document, wrap it in a map and write out the wrapper
doc = input.next()
wrapper = {
"original" => doc
}
sleep 5
log.info("Executed Ruby script")
output.write(doc, wrapper)
rescue => e
log.error("Bad Rublet " + e.message)
errWrapper = {
"errMsg" => e.message
}
error.write(errWrapper)
end
end
end
end
# The Script Snap will look for a ScriptHook object in the "hook"
# variable. The snap will then call the hook's "execute" method.
$hook = MyScript.new($log, $input, $output, $error)
This is the same script I got from Feature Request: Add delay, wait or sleep snap - #5 by krupalibshah
Until last week the script was working as expected, however suddenly I am facing this issue.
Solved! Go to Solution.
03-18-2018 09:43 PM
Thanks all.
Python works.
03-12-2018 10:17 AM
I have been using python, so I am simply stating a possibility. Are you using a local snaplex? If so, if might be worth talking to your local snaplogic admin. Maybe they upgraded the snaplex, which would have happened after 2/18/2018, and missed something.
03-13-2018 11:22 PM
Here is our wait python script
03-18-2018 09:43 PM
Thanks all.
Python works.