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); }
(Map<String, Object>) o); } else { marshallVariable = ProtobufProcessMarshaller.marshallVariable( context, "results",
public static JBPMMessages.WorkItem writeWorkItem(MarshallerWriteContext context, WorkItem workItem, boolean includeVariables) throws IOException { JBPMMessages.WorkItem.Builder _workItem = JBPMMessages.WorkItem.newBuilder() .setId( workItem.getId() ) .setProcessInstancesId( workItem.getProcessInstanceId() ) .setName( workItem.getName() ) .setState( workItem.getState() ); if (workItem instanceof org.drools.core.process.instance.WorkItem) { if (((org.drools.core.process.instance.WorkItem)workItem).getDeploymentId() != null){ _workItem.setDeploymentId(((org.drools.core.process.instance.WorkItem)workItem).getDeploymentId()); } _workItem.setNodeId(((org.drools.core.process.instance.WorkItem)workItem).getNodeId()) .setNodeInstanceId(((org.drools.core.process.instance.WorkItem)workItem).getNodeInstanceId()); } if ( includeVariables ) { Map<String, Object> parameters = workItem.getParameters(); for ( Map.Entry<String, Object> entry : parameters.entrySet() ) { _workItem.addVariable( marshallVariable( context, entry.getKey(), entry.getValue() ) ); } } return _workItem.build(); }
_instance.addVariable( ProtobufProcessMarshaller.marshallVariable( context, variable.getKey(), variable.getValue() ) );
for ( Map.Entry<String, Object> variable : variables ) { _foreach.addVariable( ProtobufProcessMarshaller.marshallVariable( context, variable.getKey(), variable.getValue() ) ); for ( Map.Entry<String, Object> variable : variables ) { _composite.addVariable( ProtobufProcessMarshaller.marshallVariable( context, variable.getKey(), variable.getValue() ) );
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 JBPMMessages.WorkItem writeWorkItem(MarshallerWriteContext context, WorkItem workItem, boolean includeVariables) throws IOException { JBPMMessages.WorkItem.Builder _workItem = JBPMMessages.WorkItem.newBuilder() .setId( workItem.getId() ) .setProcessInstancesId( workItem.getProcessInstanceId() ) .setName( workItem.getName() ) .setState( workItem.getState() ); if (workItem instanceof org.drools.core.process.instance.WorkItem) { if (((org.drools.core.process.instance.WorkItem)workItem).getDeploymentId() != null){ _workItem.setDeploymentId(((org.drools.core.process.instance.WorkItem)workItem).getDeploymentId()); } _workItem.setNodeId(((org.drools.core.process.instance.WorkItem)workItem).getNodeId()) .setNodeInstanceId(((org.drools.core.process.instance.WorkItem)workItem).getNodeInstanceId()); } if ( includeVariables ) { Map<String, Object> parameters = workItem.getParameters(); for ( Map.Entry<String, Object> entry : parameters.entrySet() ) { _workItem.addVariable( marshallVariable( context, entry.getKey(), entry.getValue() ) ); } } return _workItem.build(); }
_instance.addVariable( ProtobufProcessMarshaller.marshallVariable( context, variable.getKey(), variable.getValue() ) );
for ( Map.Entry<String, Object> variable : variables ) { _foreach.addVariable( ProtobufProcessMarshaller.marshallVariable( context, variable.getKey(), variable.getValue() ) ); for ( Map.Entry<String, Object> variable : variables ) { _composite.addVariable( ProtobufProcessMarshaller.marshallVariable( context, variable.getKey(), variable.getValue() ) );