@SuppressWarnings({ "unchecked", "rawtypes" }) private static Object fallbackParse(MarshallerReaderContext context, Header header, ExtensionRegistry registry) throws Exception { Variable parseFrom = JBPMMessages.Variable.parseFrom(header.getPayload(), registry); Object value = ProtobufProcessMarshaller.unmarshallVariableValue(context, parseFrom); if (value instanceof Map) { Map result = new HashMap(); Map<String, Variable> variablesMap = (Map<String, Variable>) value; for (String key : variablesMap.keySet()) { result.put(key, ProtobufProcessMarshaller.unmarshallVariableValue(context, variablesMap.get(key))); } return result; } return value; } }
public static Map<String, Object> unmarshallVariableContainerValue(MarshallerReaderContext context, JBPMMessages.VariableContainer _variableContiner) throws IOException, ClassNotFoundException { Map<String, Object> variables = new HashMap<String, Object>(); if (_variableContiner.getVariableCount() == 0) { return variables; } for (Variable _variable : _variableContiner.getVariableList()) { Object value = ProtobufProcessMarshaller.unmarshallVariableValue(context, _variable); variables.put(_variable.getName(), value); } return variables; }
public static WorkItem readWorkItem(MarshallerReaderContext context, JBPMMessages.WorkItem _workItem, boolean includeVariables) throws IOException { WorkItemImpl workItem = new WorkItemImpl(); workItem.setId( _workItem.getId() ); workItem.setProcessInstanceId( _workItem.getProcessInstancesId() ); workItem.setName( _workItem.getName() ); workItem.setState( _workItem.getState() ); workItem.setDeploymentId(_workItem.getDeploymentId()); workItem.setNodeId(_workItem.getNodeId()); workItem.setNodeInstanceId(_workItem.getNodeInstanceId()); if ( includeVariables ) { for ( JBPMMessages.Variable _variable : _workItem.getVariableList() ) { try { Object value = unmarshallVariableValue( context, _variable ); workItem.setParameter( _variable.getName(), value ); } catch ( ClassNotFoundException e ) { throw new IllegalArgumentException( "Could not reload parameter " + _variable.getName() + " for work item " + _workItem ); } } } return workItem; }
for ( JBPMMessages.Variable _variable : _instance.getVariableList() ) { try { Object _value = ProtobufProcessMarshaller.unmarshallVariableValue( context, _variable ); variableScopeInstance.internalSetVariable( _variable.getName(), _value );
for ( JBPMMessages.Variable _variable : _node.getContent().getComposite().getVariableList() ) { try { Object _value = ProtobufProcessMarshaller.unmarshallVariableValue( context, _variable ); variableScopeInstance.internalSetVariable( _variable.getName(), _value ); } catch ( ClassNotFoundException e ) { for ( JBPMMessages.Variable _variable : _node.getContent().getForEach().getVariableList() ) { try { Object _value = ProtobufProcessMarshaller.unmarshallVariableValue( context, _variable ); variableScopeInstance.internalSetVariable( _variable.getName(), _value ); } catch ( ClassNotFoundException e ) { for ( JBPMMessages.Variable _variable : _node.getContent().getComposite().getVariableList() ) { try { Object _value = ProtobufProcessMarshaller.unmarshallVariableValue( context, _variable ); variableScopeInstance.internalSetVariable( _variable.getName(), _value ); } catch ( ClassNotFoundException e ) {
public static Map<String, Object> unmarshallVariableContainerValue(MarshallerReaderContext context, JBPMMessages.VariableContainer _variableContiner) throws IOException, ClassNotFoundException { Map<String, Object> variables = new HashMap<String, Object>(); if (_variableContiner.getVariableCount() == 0) { return variables; } for (Variable _variable : _variableContiner.getVariableList()) { Object value = ProtobufProcessMarshaller.unmarshallVariableValue(context, _variable); variables.put(_variable.getName(), value); } return variables; }
Header _header = PersisterHelper.readFromStreamWithHeaderPreloaded(context, registry); Variable parseFrom = JBPMMessages.Variable.parseFrom(_header.getPayload(), registry); Object value = ProtobufProcessMarshaller.unmarshallVariableValue(context, parseFrom); Map<String, Variable> variablesMap = (Map<String, Variable>) value; for (String key : variablesMap.keySet()) { result.put(key, ProtobufProcessMarshaller.unmarshallVariableValue(context, variablesMap.get(key)));
public static WorkItem readWorkItem(MarshallerReaderContext context, JBPMMessages.WorkItem _workItem, boolean includeVariables) throws IOException { WorkItemImpl workItem = new WorkItemImpl(); workItem.setId( _workItem.getId() ); workItem.setProcessInstanceId( _workItem.getProcessInstancesId() ); workItem.setName( _workItem.getName() ); workItem.setState( _workItem.getState() ); workItem.setDeploymentId(_workItem.getDeploymentId()); workItem.setNodeId(_workItem.getNodeId()); workItem.setNodeInstanceId(_workItem.getNodeInstanceId()); if ( includeVariables ) { for ( JBPMMessages.Variable _variable : _workItem.getVariableList() ) { try { Object value = unmarshallVariableValue( context, _variable ); workItem.setParameter( _variable.getName(), value ); } catch ( ClassNotFoundException e ) { throw new IllegalArgumentException( "Could not reload parameter " + _variable.getName() + " for work item " + _workItem ); } } } return workItem; }
for ( JBPMMessages.Variable _variable : _instance.getVariableList() ) { try { Object _value = ProtobufProcessMarshaller.unmarshallVariableValue( context, _variable ); variableScopeInstance.internalSetVariable( _variable.getName(), _value );
for ( JBPMMessages.Variable _variable : _node.getContent().getComposite().getVariableList() ) { try { Object _value = ProtobufProcessMarshaller.unmarshallVariableValue( context, _variable ); variableScopeInstance.internalSetVariable( _variable.getName(), _value ); } catch ( ClassNotFoundException e ) { for ( JBPMMessages.Variable _variable : _node.getContent().getForEach().getVariableList() ) { try { Object _value = ProtobufProcessMarshaller.unmarshallVariableValue( context, _variable ); variableScopeInstance.internalSetVariable( _variable.getName(), _value ); } catch ( ClassNotFoundException e ) { for ( JBPMMessages.Variable _variable : _node.getContent().getComposite().getVariableList() ) { try { Object _value = ProtobufProcessMarshaller.unmarshallVariableValue( context, _variable ); variableScopeInstance.internalSetVariable( _variable.getName(), _value ); } catch ( ClassNotFoundException e ) {