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

The following examples show how to use org.camunda.bpm.engine.variable.Variables#shortValue() . 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: PrimitiveValueTypeImpl.java    From camunda-bpm-platform with Apache License 2.0 6 votes vote down vote up
@Override
public ShortValue convertFromTypedValue(TypedValue typedValue) {
  if (typedValue.getType() != ValueType.NUMBER) {
    throw unsupportedConversion(typedValue.getType());
  }

  ShortValueImpl shortValue = null;
  NumberValue numberValue = (NumberValue) typedValue;
  if (numberValue.getValue() != null) {
    shortValue = (ShortValueImpl) Variables.shortValue(numberValue.getValue().shortValue());
  } else {
    shortValue =  (ShortValueImpl) Variables.shortValue(null);
  }
  shortValue.setTransient(numberValue.isTransient());
  return shortValue;
}
 
Example 2
Source File: ShortValueMapper.java    From camunda-external-task-client-java with Apache License 2.0 5 votes vote down vote up
public ShortValue readValue(TypedValueField typedValueField) {
  Short shortValue = null;

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

  return Variables.shortValue(shortValue);
}
 
Example 3
Source File: ShortValueSerializer.java    From camunda-bpm-platform with Apache License 2.0 5 votes vote down vote up
public ShortValue readValue(ValueFields valueFields, boolean asTransientValue) {
  Long longValue = valueFields.getLongValue();
  Short shortValue = null;

  if(longValue != null) {
    shortValue = Short.valueOf(longValue.shortValue());
  }

  return Variables.shortValue(shortValue, asTransientValue);
}
 
Example 4
Source File: ShortValueMapper.java    From camunda-external-task-client-java with Apache License 2.0 4 votes vote down vote up
public ShortValue convertToTypedValue(UntypedValueImpl untypedValue) {
  return Variables.shortValue((Short) untypedValue.getValue());
}
 
Example 5
Source File: ShortValueSerializer.java    From camunda-bpm-platform with Apache License 2.0 4 votes vote down vote up
public ShortValue convertToTypedValue(UntypedValueImpl untypedValue) {
  return Variables.shortValue((Short) untypedValue.getValue(), untypedValue.isTransient());
}
 
Example 6
Source File: PrimitiveValueTypeImpl.java    From camunda-bpm-platform with Apache License 2.0 4 votes vote down vote up
public ShortValue createValue(Object value, Map<String, Object> valueInfo) {
  return Variables.shortValue((Short) value, isTransient(valueInfo));
}