public WorkItem getWorkItem(Environment env) {
this.env = env;
if ( workItem == null ) {
try {
ByteArrayInputStream bais = new ByteArrayInputStream( workItemByteArray );
MarshallerReaderContext context = new MarshallerReaderContext( bais,
null,
null,
null,
env);
workItem = InputMarshaller.readWorkItem( context );
context.close();
} catch ( IOException e ) {
e.printStackTrace();
throw new IllegalArgumentException( "IOException while loading process instance: " + e.getMessage() );
}
}