continue; if (strategy.accept(variable.getValue())) { logger.debug("Strategy of type {} found to handle variable '{}'", strategy, variable.getKey()); try {
public static void writeWorkItem_v1(MarshallerWriteContext context, WorkItem workItem) throws IOException { ObjectOutputStream stream = context.stream; stream.writeLong( workItem.getId() ); stream.writeLong( workItem.getProcessInstanceId() ); stream.writeUTF( workItem.getName() ); stream.writeInt( workItem.getState() ); //Work Item Parameters Map<String, Object> parameters = workItem.getParameters(); Collection<Object> notNullValues = new ArrayList<Object>(); for ( Object value : parameters.values() ) { if ( value != null ) { notNullValues.add( value ); } } stream.writeInt( notNullValues.size() ); for ( String key : parameters.keySet() ) { Object object = parameters.get( key ); if ( object != null ) { stream.writeUTF( key ); int index = context.objectMarshallingStrategyStore.getStrategy( object ); stream.writeInt( index ); ObjectMarshallingStrategy strategy = context.objectMarshallingStrategyStore.getStrategy( index ); if ( strategy.accept( object ) ) { strategy.write( stream, object ); } } } }
continue; if (strategy.accept(variable.getValue())) { logger.debug("Strategy of type {} found to handle variable '{}'", strategy, variable.getKey()); try {
public static void writeWorkItem_v1(MarshallerWriteContext context, WorkItem workItem) throws IOException { ObjectOutputStream stream = context.stream; stream.writeLong( workItem.getId() ); stream.writeLong( workItem.getProcessInstanceId() ); stream.writeUTF( workItem.getName() ); stream.writeInt( workItem.getState() ); //Work Item Parameters Map<String, Object> parameters = workItem.getParameters(); Collection<Object> notNullValues = new ArrayList<Object>(); for ( Object value : parameters.values() ) { if ( value != null ) { notNullValues.add( value ); } } stream.writeInt( notNullValues.size() ); for ( String key : parameters.keySet() ) { Object object = parameters.get( key ); if ( object != null ) { stream.writeUTF( key ); int index = context.objectMarshallingStrategyStore.getStrategy( object ); stream.writeInt( index ); ObjectMarshallingStrategy strategy = context.objectMarshallingStrategyStore.getStrategy( index ); if ( strategy.accept( object ) ) { strategy.write( stream, object ); } } } }