Java Code Examples for org.camunda.bpm.engine.variable.Variables#doubleValue()

The following examples show how to use org.camunda.bpm.engine.variable.Variables#doubleValue() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DoubleValueMapper.java    From camunda-external-task-client-java with Apache License 2.0 5 votes vote down vote up
public DoubleValue readValue(TypedValueField typedValueField) {
  Double doubleValue = null;

  Object value = typedValueField.getValue();
  if (value != null) {
    Number numValue = (Number) value;
    doubleValue = numValue.doubleValue();
  }

  return Variables.doubleValue(doubleValue);
}
 
Example 2
Source File: PrimitiveValueTypeImpl.java    From camunda-bpm-platform with Apache License 2.0 5 votes vote down vote up
@Override
public DoubleValue convertFromTypedValue(TypedValue typedValue) {
  if (typedValue.getType() != ValueType.NUMBER) {
    throw unsupportedConversion(typedValue.getType());
  }
  DoubleValueImpl doubleValue = null;
  NumberValue numberValue = (NumberValue) typedValue;
  if (numberValue.getValue() != null) {
    doubleValue = (DoubleValueImpl) Variables.doubleValue(numberValue.getValue().doubleValue());
  } else {
    doubleValue = (DoubleValueImpl) Variables.doubleValue(null);
  }
  doubleValue.setTransient(numberValue.isTransient());
  return doubleValue;
}
 
Example 3
Source File: DoubleValueMapper.java    From camunda-external-task-client-java with Apache License 2.0 4 votes vote down vote up
public DoubleValue convertToTypedValue(UntypedValueImpl untypedValue) {
  return Variables.doubleValue((Double) untypedValue.getValue());
}
 
Example 4
Source File: DoubleValueSerializer.java    From camunda-bpm-platform with Apache License 2.0 4 votes vote down vote up
public DoubleValue convertToTypedValue(UntypedValueImpl untypedValue) {
  return Variables.doubleValue((Double) untypedValue.getValue(), untypedValue.isTransient());
}
 
Example 5
Source File: DoubleValueSerializer.java    From camunda-bpm-platform with Apache License 2.0 4 votes vote down vote up
public DoubleValue readValue(ValueFields valueFields, boolean asTransientValue) {
  return Variables.doubleValue(valueFields.getDoubleValue(), asTransientValue);
}
 
Example 6
Source File: PrimitiveValueTypeImpl.java    From camunda-bpm-platform with Apache License 2.0 4 votes vote down vote up
public DoubleValue createValue(Object value, Map<String, Object> valueInfo) {
  return Variables.doubleValue((Double) value, isTransient(valueInfo));
}