flowable / flowable/flowable-engine
A helper class for basic EL operations is needed. Ex build a map in EL, build an array or list
- Lingua principale
- Java
- Stelle
- 9.5k
- Fork
- 2.9k
- Merge medio
- 7h 8m
- PR unite (30g)
- 2
Descrizione
Here are some examples:
```
build map:
${
op.asMap()
.put("key1", "value1")
.put("key2", "value2")
.done()
}
build list:
${
op.asList("item1", "item2")
}
build array:
${
op.asArray("item1", "item2")
}
concat strings:
${
"str1".concat("str2")
}
```
```
package org.flowable.app.service.addon;
import org.springframework.stereotype.Component;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
@Component("op")
public class Operation
{
public T[] asArray(T... objects)
{
return objects;
}
public List asList(T... objects)
{
return Arrays.asList(objects);
}
public MapBuilder asMap()
{
return new MapBuilder();
}
}
```
```
package org.flowable.app.service.addon;
import java.util.HashMap;
import java.util.Map;
public class MapBuilder
{
private Map map = new HashMap();
public MapBuilder put(K key, V value)
{
map.put(key, value);
return this;
}
public Map done()
{
return map;
}
}
```
I think it would be useful to have such utility class and have it documented in flowable documentation.
EL is lacking those basic operations, but they can be a part from library.
Thanks
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Valutazione
Questa issue non è ancora stata valutata.