I'm unable to find a correct API to set the workflow global and task variables using an external class to remotely invoke a workflow.
My job spec looks like - as attached.
I'm using createWorkflow to create my workflow and passing the updated document as xml.
I tried using doc.selectSingleNode("/workflow/variables/variable[
@key=setglobal1]/@value").setText(something123);
But this doesn't work. Any other suggestions?