public Object getInputParameterValue(String inputParameterKey) { TypedValue typedValue = inputParameters!=null ? inputParameters.get(inputParameterKey) : null; return typedValue!=null ? typedValue.getValue() : null; } }
public Object getInputParameterValue(String inputParameterKey) { TypedValue typedValue = inputParameters!=null ? inputParameters.get(inputParameterKey) : null; return typedValue!=null ? typedValue.getValue() : null; } }
public Object getValue(String variableId) { TypedValue value = values!=null ? values.get(variableId) : null; return value!=null ? value.getValue() : null; }
public Object getData(String key) { TypedValue value = data!=null ? data.get(key) : null; return value!=null ? value.getValue() : null; }
public Object getData(String key) { TypedValue value = data!=null ? data.get(key) : null; return value!=null ? value.getValue() : null; }
public Object getValue(String variableId) { TypedValue value = values!=null ? values.get(variableId) : null; return value!=null ? value.getValue() : null; }
public Object getValue(String parameterKey) { Map<String, TypedValue> inputParameters = executeRequest.getInputParameters(); if (!inputParameters.containsKey(parameterKey)) { log.debug("Parameter '"+parameterKey+"' not available"); return null; } TypedValue typedValue = inputParameters.get(parameterKey); if (typedValue==null) { log.debug("Parameter '"+parameterKey+"' has value null"); return null; } return typedValue.getValue(); }
/** sets all entries individually, variableValues maps variable ids to values */ public void setVariableValues(DataContainer variableValues) { Map<String, TypedValue> data = variableValues!=null ? variableValues.getData() : null; if (data!=null) { for (String variableId: data.keySet()) { TypedValue value = data.get(variableId); setVariableValue(variableId, value.getValue()); } } }
/** * Copies the trigger data from the given {@link com.effektif.workflow.api.model.TriggerInstance} to the given * {@link com.effektif.workflow.impl.workflowinstance.WorkflowInstanceImpl} when starting a workflow. */ public void applyTriggerData(WorkflowInstanceImpl workflowInstance, TriggerInstance triggerInstance) { Map<String, TypedValue> data = triggerInstance.getData(); if (data!=null) { for (String key: data.keySet()) { TypedValue typedValue = data.get(key); Object value = typedValue!=null ? typedValue.getValue() : null; String outputVariableId = outputs!=null ? outputs.get(key) : null; if (value!=null && outputVariableId!=null) { workflowInstance.setVariableValue(outputVariableId, value); } } } } }
public void setVariableValues(WorkflowInstanceId workflowInstanceId, String activityInstanceId, VariableValues variableValues) { if (workflowInstanceId==null || variableValues==null) { return; } WorkflowInstanceImpl workflowInstance = lockWorkflowInstanceWithRetry(workflowInstanceId); ScopeInstanceImpl scopeInstance = getScopeInstance(workflowInstance, activityInstanceId); if (scopeInstance==null) { workflowInstanceStore.unlockWorkflowInstance(workflowInstance); throw new RuntimeException("Workflow instance "+workflowInstanceId+" didn't contain active activityInstanceId "+activityInstanceId); } Map<String, TypedValue> values = variableValues!=null ? variableValues.getValues() : null; if (values!=null) { for (String variableId : values.keySet()) { TypedValue typedValue = values.get(variableId); Object value = typedValue.getValue(); scopeInstance.setVariableValue(variableId, value); } } workflowInstanceStore.flushAndUnlock(workflowInstance); }
@Override public void write(TypedValue typeValue, JsonWriter jsonWriter) { DataType dataType = typeValue.getDataType(); Object value = typeValue.getValue(); if (dataType==null && value!=null) { dataType = mappings.getTypeByValue(value); typeValue.setDataType(dataType); } super.write(typeValue, jsonWriter); }
@Override public TypedValue read(Object jsonValue, JsonReader jsonReader) { TypedValue typedValue = super.read(jsonValue, jsonReader); DataType dataType = typedValue.getDataType(); Object jsonVariableValue = typedValue.getValue(); if (jsonVariableValue!=null && dataType!=null) { Object objectVariableValue = jsonReader.readObject(jsonVariableValue, dataType.getValueType()); typedValue.setValue(objectVariableValue); } return typedValue; }
activityInstance.setVariableValue(variableId, typedValue.getValue()); else log.warn("Variable type not defined for variable " + variableId);
activityInstance.setVariableValue(variableId, typedValue.getValue()); else log.warn("Variable type not defined for variable " + variableId);