flowable / flowable/flowable-engine

A helper class for basic EL operations is needed. Ex build a map in EL, build an array or list

Open
#183 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
9.5k
Forks
2.9k
Avg merge
7h 8m
Merged PRs (30d)
2

Description

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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.