public static Variable marshallVariablesMap(MarshallerWriteContext context, Map<String, Object> variables) throws IOException{ Map<String, Variable> marshalledVariables = new HashMap<String, Variable>(); for(String key : variables.keySet()){ JBPMMessages.Variable.Builder builder = JBPMMessages.Variable.newBuilder().setName( key ); if(variables.get(key) != null){ ObjectMarshallingStrategy strategy = context.objectMarshallingStrategyStore.getStrategyObject( variables.get(key) ); Integer index = context.getStrategyIndex( strategy ); builder.setStrategyIndex( index ) .setValue( ByteString.copyFrom( strategy.marshal( context.strategyContext.get( strategy ), context, variables.get(key) ) ) ); } marshalledVariables.put(key, builder.build()); } return marshallVariable(context, "variablesMap" ,marshalledVariables); }
public void write(MarshallerWriteContext context) throws IOException { context.writeInt( WorkingMemoryAction.SignalProcessInstanceAction ); context.writeLong(processInstanceId); context.writeUTF(type); context.writeBoolean(event != null); if (event != null) { context.writeObject(event); } }
ByteArrayOutputStream baos = new ByteArrayOutputStream(); MarshallerWriteContext writerContext = new MarshallerWriteContext(baos, ((InternalKnowledgeBase) kbase), (InternalWorkingMemory) ((StatefulKnowledgeSessionImpl) ksession), writerContext.close(); byte[] bytes = baos.toByteArray(); int numCorrectBytes = calculateNumBytesForLong(processInstance.getId());
MarshallerWriteContext outContext = new MarshallerWriteContext( baos, null, null, null, new ObjectMarshallingStrategyStoreImpl(strats), true, true, null); OldOutputMarshallerMethods.writeFactHandle_v1(outContext, (ObjectOutputStream) outContext, outContext.objectMarshallingStrategyStore, 2, factHandle); outContext.close(); byteArray = baos.toByteArray();
@Override public void transform() { this.state = workItem.getState(); ByteArrayOutputStream baos = new ByteArrayOutputStream(); try { MarshallerWriteContext context = new MarshallerWriteContext( baos, null, null, null, null, this.env); ProtobufOutputMarshaller.writeWorkItem(context, workItem); context.close(); this.workItemByteArray = baos.toByteArray(); } catch ( IOException e ) { throw new IllegalArgumentException( "IOException while storing workItem " + workItem.getId() + ": " + e.getMessage() ); } }
public void write(MarshallerWriteContext context) throws IOException { context.writeInt( WorkingMemoryAction.SignalAction ); context.writeUTF(type); context.writeBoolean(event != null); if (event != null) { context.writeObject(event); } }
public static VariableContainer marshallVariablesContainer(MarshallerWriteContext context, Map<String, Object> variables) throws IOException{ JBPMMessages.VariableContainer.Builder vcbuilder = JBPMMessages.VariableContainer.newBuilder(); for(String key : variables.keySet()){ JBPMMessages.Variable.Builder builder = JBPMMessages.Variable.newBuilder().setName( key ); if(variables.get(key) != null){ ObjectMarshallingStrategy strategy = context.objectMarshallingStrategyStore.getStrategyObject( variables.get(key) ); Integer index = context.getStrategyIndex( strategy ); builder.setStrategyIndex( index ) .setValue( ByteString.copyFrom( strategy.marshal( context.strategyContext.get( strategy ), context, variables.get(key) ) ) ); } vcbuilder.addVariable(builder.build()); } return vcbuilder.build(); }
MarshallerWriteContext outContext = new MarshallerWriteContext( baos, null, null, null, new ObjectMarshallingStrategyStoreImpl(strats), true, true, null); OldOutputMarshallerMethods.writeFactHandle_v1(outContext, (ObjectOutputStream) outContext, outContext.objectMarshallingStrategyStore, 2, factHandle); outContext.close(); byteArray = baos.toByteArray();
public void write(MarshallerWriteContext context) throws IOException { context.writeInt( WorkingMemoryAction.SignalProcessInstanceAction ); context.writeLong(processInstanceId); context.writeUTF(type); context.writeBoolean(event != null); if (event != null) { context.writeObject(event); } }
public static Variable marshallVariable(MarshallerWriteContext context, String name, Object value) throws IOException { JBPMMessages.Variable.Builder builder = JBPMMessages.Variable.newBuilder().setName( name ); if(value != null){ ObjectMarshallingStrategy strategy = context.objectMarshallingStrategyStore.getStrategyObject( value ); Integer index = context.getStrategyIndex( strategy ); builder.setStrategyIndex( index ) .setValue( ByteString.copyFrom( strategy.marshal( context.strategyContext.get( strategy ), context, value ) ) ); } return builder.build(); }
public void write(MarshallerWriteContext context) throws IOException { context.writeInt( WorkingMemoryAction.SignalAction ); context.writeUTF(type); context.writeBoolean(event != null); if (event != null) { context.writeObject(event); } }
public static Variable marshallVariablesMap(MarshallerWriteContext context, Map<String, Object> variables) throws IOException{ Map<String, Variable> marshalledVariables = new HashMap<String, Variable>(); for(String key : variables.keySet()){ JBPMMessages.Variable.Builder builder = JBPMMessages.Variable.newBuilder().setName( key ); if(variables.get(key) != null){ ObjectMarshallingStrategy strategy = context.objectMarshallingStrategyStore.getStrategyObject( variables.get(key) ); Integer index = context.getStrategyIndex( strategy ); builder.setStrategyIndex( index ) .setValue( ByteString.copyFrom( strategy.marshal( context.strategyContext.get( strategy ), context, variables.get(key) ) ) ); } marshalledVariables.put(key, builder.build()); } return marshallVariable(context, "variablesMap" ,marshalledVariables); }
public static VariableContainer marshallVariablesContainer(MarshallerWriteContext context, Map<String, Object> variables) throws IOException{ JBPMMessages.VariableContainer.Builder vcbuilder = JBPMMessages.VariableContainer.newBuilder(); for(String key : variables.keySet()){ JBPMMessages.Variable.Builder builder = JBPMMessages.Variable.newBuilder().setName( key ); if(variables.get(key) != null){ ObjectMarshallingStrategy strategy = context.objectMarshallingStrategyStore.getStrategyObject( variables.get(key) ); Integer index = context.getStrategyIndex( strategy ); builder.setStrategyIndex( index ) .setValue( ByteString.copyFrom( strategy.marshal( context.strategyContext.get( strategy ), context, variables.get(key) ) ) ); } vcbuilder.addVariable(builder.build()); } return vcbuilder.build(); }
public static Variable marshallVariable(MarshallerWriteContext context, String name, Object value) throws IOException { JBPMMessages.Variable.Builder builder = JBPMMessages.Variable.newBuilder().setName( name ); if(value != null){ ObjectMarshallingStrategy strategy = context.objectMarshallingStrategyStore.getStrategyObject( value ); Integer index = context.getStrategyIndex( strategy ); builder.setStrategyIndex( index ) .setValue( ByteString.copyFrom( strategy.marshal( context.strategyContext.get( strategy ), context, value ) ) ); } return builder.build(); }