Add JavaScript objects to the workflow scratchpad

You can add any JavaScript object to the scratchpad if the object can be represented as JSON.

Whenever possible, group related values into a single JavaScript object and add this object to the scratchpad instead of storing each value individually.

    // complex JavaScript object
    var joe = {
           name:  'Joe Watkins',
            age:  45,
            job:  'Electrical Engineer',
        contact:  ['760-555-1212', 'joew@fastereng.net'],
        vaction:  { start: new Date("October 12, 2013"), days: 5 }
    }
 
     passUserToAnotherActivityViaScratchpad( joe );
 
    function passUserToAnotherActivityViaScratchpad(usr) {
	     workflow.scratchpad.user = usr;
    }