How to call arguments in ActionQueue.submitAction


#1

I’m trying to submit an action to the ActionQueue using submitAction, and to try it out, I was trying to test a simple fetch call: JupyterNotebook.fetch({ filter: Filter.contains( 'name', 'Tut' ) })

This was my implementation:

ActionQueue.submitAction(JupyterNotebook, 'fetch', ActionQueueContext.make({
    arguments: {
    	'spec' : {
	    	'filter': Filter.contains('name', 'Tut')
	    }
    }
}))

However, the action failed with the error:

“Argument spec is class com.fasterxml.jackson.databind.node.ObjectNode but must be Obj or ObjArry.”

I retried the action in several different ways, changing the structure of ActionQueueContext.arguments, but kept getting the same error.

What is the correct way to pass arguments? I notice it expects a map<string, any>, but I assumed the type system would automatically convert the object to a c3 map?


#2

Update: The problem seemed to go away when I was explicitly passing the type instance into the arguments for ActionQueueContext; it looks like it is not cast the same way as a call made from the client side console.

ActionQueue.submitAction(JupyterNotebook, 'fetch', ActionQueueContext.make({
    arguments: {
        spec : FetchSpec.make({filter: Filter.contains('name', 'Tut')})
    }
}))