本文整理了Java中org.camunda.bpm.engine.variable.Variables.dateValue()
方法的一些代码示例,展示了Variables.dateValue()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Variables.dateValue()
方法的具体详情如下:
包路径:org.camunda.bpm.engine.variable.Variables
类名称:Variables
方法名:dateValue
[英]Creates a new DateValue that encapsulates the given date
[中]创建一个新的日期值,该值封装给定的date
代码示例来源:origin: camunda/camunda-bpm-platform
/**
* Creates a new {@link DateValue} that encapsulates the given <code>date</code>
*/
public static DateValue dateValue(Date date) {
return dateValue(date, false);
}
代码示例来源:origin: camunda/camunda-bpm-platform
@Override
public TypedValue transform(Object value) throws IllegalArgumentException {
if (value instanceof Date) {
return Variables.dateValue((Date) value);
} else if (value instanceof String) {
Date date = transformString((String) value);
return Variables.dateValue(date);
} else {
throw new IllegalArgumentException();
}
}
代码示例来源:origin: camunda/camunda-bpm-platform
public DateValue readValue(ValueFields valueFields) {
Long longValue = valueFields.getLongValue();
Date dateValue = null;
if (longValue!=null) {
dateValue = new Date(longValue);
}
return Variables.dateValue(dateValue);
}
代码示例来源:origin: camunda/camunda-bpm-platform
public DateValue readValue(ValueFields valueFields) {
Long longValue = valueFields.getLongValue();
Date dateValue = null;
if (longValue!=null) {
dateValue = new Date(longValue);
}
return Variables.dateValue(dateValue);
}
代码示例来源:origin: camunda/camunda-bpm-platform
public DateValue createValue(Object value, Map<String, Object> valueInfo) {
return Variables.dateValue((Date) value, isTransient(valueInfo));
}
代码示例来源:origin: camunda/camunda-bpm-platform
public DateValue convertToTypedValue(UntypedValueImpl untypedValue) {
return Variables.dateValue((Date) untypedValue.getValue(), untypedValue.isTransient());
}
代码示例来源:origin: camunda/camunda-bpm-platform
public DateValue convertToTypedValue(UntypedValueImpl untypedValue) {
return Variables.dateValue((Date) untypedValue.getValue(), untypedValue.isTransient());
}
代码示例来源:origin: camunda/camunda-bpm-platform
public TypedValue convertToModelValue(TypedValue propertyValue) {
Object value = propertyValue.getValue();
if(value == null) {
return Variables.dateValue(null, propertyValue.isTransient());
}
else if(value instanceof Date) {
return Variables.dateValue((Date) value, propertyValue.isTransient());
}
else if(value instanceof String) {
String strValue = ((String) value).trim();
if (strValue.isEmpty()) {
return Variables.dateValue(null, propertyValue.isTransient());
}
try {
return Variables.dateValue((Date) dateFormat.parseObject(strValue), propertyValue.isTransient());
} catch (ParseException e) {
throw new ProcessEngineException("Could not parse value '"+value+"' as date using date format '"+datePattern+"'.");
}
}
else {
throw new ProcessEngineException("Value '"+value+"' cannot be transformed into a Date.");
}
}
代码示例来源:origin: camunda/camunda-bpm-platform
public TypedValue convertToModelValue(TypedValue propertyValue) {
Object value = propertyValue.getValue();
if(value == null) {
return Variables.dateValue(null, propertyValue.isTransient());
}
else if(value instanceof Date) {
return Variables.dateValue((Date) value, propertyValue.isTransient());
}
else if(value instanceof String) {
String strValue = ((String) value).trim();
if (strValue.isEmpty()) {
return Variables.dateValue(null, propertyValue.isTransient());
}
try {
return Variables.dateValue((Date) dateFormat.parseObject(strValue), propertyValue.isTransient());
} catch (ParseException e) {
throw new ProcessEngineException("Could not parse value '"+value+"' as date using date format '"+datePattern+"'.");
}
}
else {
throw new ProcessEngineException("Value '"+value+"' cannot be transformed into a Date.");
}
}
代码示例来源:origin: camunda/camunda-bpm-platform
@Before
public void setUpRuntimeData() {
runtimeServiceMock = mock(RuntimeServiceImpl.class);
when(runtimeServiceMock.getVariableTyped(eq(EXAMPLE_PROCESS_INSTANCE_ID), eq(EXAMPLE_VARIABLE_KEY), eq(true)))
.thenReturn(Variables.dateValue(testDate));
when(processEngine.getRuntimeService()).thenReturn(runtimeServiceMock);
}
代码示例来源:origin: org.camunda.commons/camunda-commons-typed-values
/**
* Creates a new {@link DateValue} that encapsulates the given <code>date</code>
*/
public static DateValue dateValue(Date date) {
return dateValue(date, false);
}
代码示例来源:origin: camunda/camunda-bpm-platform
@Parameters(name = "{index}: variable = {0}")
public static Collection<Object[]> data() {
return Arrays
.asList(new Object[][] {
{ Variables.stringValue("a"), Variables.stringValue(null) },
{ Variables.booleanValue(true), Variables.booleanValue(null) },
{ Variables.integerValue(4), Variables.integerValue(null) },
{ Variables.shortValue((short) 2), Variables.shortValue(null) },
{ Variables.longValue(6L), Variables.longValue(null) },
{ Variables.doubleValue(4.2), Variables.doubleValue(null) },
{ Variables.dateValue(new Date()), Variables.dateValue(null) }
});
}
代码示例来源:origin: org.camunda.bpm.dmn/camunda-engine-dmn
@Override
public TypedValue transform(Object value) throws IllegalArgumentException {
if (value instanceof Date) {
return Variables.dateValue((Date) value);
} else if (value instanceof String) {
Date date = transformString((String) value);
return Variables.dateValue(date);
} else {
throw new IllegalArgumentException();
}
}
代码示例来源:origin: camunda/camunda-engine-dmn
@Override
public TypedValue transform(Object value) throws IllegalArgumentException {
if (value instanceof Date) {
return Variables.dateValue((Date) value);
} else if (value instanceof String) {
Date date = transformString((String) value);
return Variables.dateValue(date);
} else {
throw new IllegalArgumentException();
}
}
代码示例来源:origin: org.camunda.bpm/camunda-engine
public DateValue readValue(ValueFields valueFields) {
Long longValue = valueFields.getLongValue();
Date dateValue = null;
if (longValue!=null) {
dateValue = new Date(longValue);
}
return Variables.dateValue(dateValue);
}
代码示例来源:origin: org.camunda.commons/camunda-commons-typed-values
public DateValue createValue(Object value, Map<String, Object> valueInfo) {
return Variables.dateValue((Date) value, isTransient(valueInfo));
}
代码示例来源:origin: camunda/camunda-bpm-platform
.putValueTyped("b", Variables.booleanValue(true, true))
.putValueTyped("c", Variables.byteArrayValue("test".getBytes(), true))
.putValueTyped("d", Variables.dateValue(new Date(), true))
.putValueTyped("e", Variables.doubleValue(20., true))
.putValueTyped("f", Variables.integerValue(10, true))
代码示例来源:origin: camunda/camunda-bpm-platform
.putValue("b", Variables.booleanValue(true, true))
.putValue("c", Variables.byteArrayValue("test".getBytes(), true))
.putValue("d", Variables.dateValue(new Date(), true))
.putValue("e", Variables.doubleValue(20., true))
.putValue("f", Variables.integerValue(10, true))
代码示例来源:origin: org.camunda.bpm/camunda-engine
public DateValue convertToTypedValue(UntypedValueImpl untypedValue) {
return Variables.dateValue((Date) untypedValue.getValue(), untypedValue.isTransient());
}
代码示例来源:origin: org.camunda.bpm/camunda-engine
@Parameters(name = "{index}: variable = {0}")
public static Collection<Object[]> data() {
return Arrays
.asList(new Object[][] {
{ Variables.stringValue("a"), Variables.stringValue(null) },
{ Variables.booleanValue(true), Variables.booleanValue(null) },
{ Variables.integerValue(4), Variables.integerValue(null) },
{ Variables.shortValue((short) 2), Variables.shortValue(null) },
{ Variables.longValue(6L), Variables.longValue(null) },
{ Variables.doubleValue(4.2), Variables.doubleValue(null) },
{ Variables.dateValue(new Date()), Variables.dateValue(null) }
});
}
内容来源于网络,如有侵权,请联系作者删除!