Hi Nikku,
here what we envision to
- allow adding a standard script task that will be fed with some input parameters
- allow to in addition modify the script to exact needs
I just quickly sketched from the top of my head. I hope there are not too many mistakes in it but should hopefully be enough to extract what I mean:
[
{
"appliesTo": [
"bpmn:ScriptTask"
],
"id": "Fibonacci",
"name": "Calculate Fibonacci",
"properties": [
{
"binding": {
"name": "name",
"type": "property"
},
"label": "Task Name",
"type": "Hidden",
"value": "Calculate Fibonacci"
},
{
"binding": {
"name": "scriptFormat",
"type": "property"
},
"type": "Hidden",
"value": "Groovy"
},
{
"binding": {
"name": "fibParam",
"type": "camunda:inputParameter"
},
"description": "Input number to calculate Fibonacci",
"label": "Input value",
"type": "String",
"value": "8"
},
{
"binding": {
"type": "bpmn:script"
},
"type": "Hidden",
"value": "<![CDATA[def fib(n) {n<2 ? 1 : fib(n-1)+fib(n-2)}\nfib(fibParam)]]>"
},
{
"binding": {
"name": "camunda:resultVariable",
"type": "property"
},
"description": "Name of the variable containing the result.",
"label": "Resulting Fibonacci value",
"type": "String",
"value": "outputValue"
}
]
},
{
"appliesTo": [
"bpmn:ScriptTask"
],
"id": "MapUserTable",
"name": "Map User List",
"properties": [
{
"binding": {
"name": "name",
"type": "property"
},
"label": "Task Name",
"type": "Hidden",
"value": "Map User List"
},
{
"binding": {
"name": "scriptFormat",
"type": "property"
},
"type": "Hidden",
"value": "Groovy"
},
{
"binding": {
"name": "filterUsers",
"type": "camunda:inputParameter"
},
"description": "Commas separated list of users to filter. Empty for all users.",
"label": "Filter by users",
"type": "String",
"value": ""
},
{
"binding": {
"type": "bpmn:script"
},
"description": "Groovy Script to filter and map user information",
"label": "Apply mapping of input (Groovy script)",
"type": "Text",
"value": "<![CDATA[import groovy.json.JsonSlurper\nimport java.util.logging.Logger\n\nLogger log = Logger.getLogger(\"mapUserData\")\n\nlog.info(\"mapping users '$filterUsers'\")\nresult = users.findAll{ user -> user.id in filterUsers.split(',')}.collect{ \n filteredUser = [:]\n\n// Change Mapping depending on required result information\n filteredUser.id = it.id\n filteredUser.mail = it.email\n filteredUser\n}\nresult]]>"
},
{
"binding": {
"name": "camunda:resultVariable",
"type": "property"
},
"description": "Name of the variable containing the result.",
"label": "Resulting map with user data",
"type": "String",
"value": "outputValue"
}
]
}
]