if you do want to set a variable in the workflow use the following code
kcontext.setVariable("userId", "user"); //where userId is the variable name and user is the name of the user
this can be put in either a script task of its own, or in the on-entry or on-exit event of another task
<userTask id="_5" name="Human Task" >
<extensionElements>
<tns:onEntry-script scriptFormat="http://www.java.com/java">
<script>
kcontext.setVariable("userId", "user");
</script>
</tns:onEntry-script>
</extensionElements>
<ioSpecification>
...
</userTask>