One this is that you don’t need to add the default value.
By default if the variable specified already has a value, it will be populated by the form, so you can remove the expression you have.
The details of the error you experience are likely going to be in logs,i would check that out to see about what specifically is wrong.
I found the following in the logs:
Caused by: java.lang.NumberFormatException: For input string: “2116.190476190476”
at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:68) ~[na:na]
at java.base/java.lang.Long.parseLong(Long.java:707) ~[na:na]
at java.base/java.lang.Long.(Long.java:1344) ~[na:na]
So the variable “amount” has a wrong datatype or what does it mean?
The form is expecting a Long but you’re sending a String from your worker.
So either change the form so that it displays a string or change the worker to return a Long
I wanted to know whether the variable “amount” will then be classified as integer / long in the further process or as a string. For this reason I added a gateway. Seems to work anyway and the data type is Integer / Double at the end of the process. I just wondered why that is.
Another question:
How would the query / code via REST-API look like if I post the two variables directly into the human task (“Check Payment”). I know how to start a process right from the start via REST, but is it also possible to start the process in the middle and skip previous steps? If not, is there still a chance to implement variables in an existing process?
I didn’t find anything suitable in the documentation. For example, I tried the following:
If you want to start the process at a different point, you have to adjust your process model by adding another message start event. [forum.bpmn (6.5 KB) ] This can be then triggered via REST-call and you can pass the variables within the call.
If the process is started and the instance is at the user task, you can also claim the task and complete it via REST API and pass variables along. You could also add a form field that will declare a variable and the user in the user task can then initials the value.
Another way of achieving this in the process logic could be to model an event subprocess with an non-interrupting message start event. The message that is sent can contain variables (same call as the start message). But be aware of message correlation.
If your model does not contain the possibility to pass variables at defined points, you can add and change Variables inside Cockpit, but this would be more the approach for an administrator to fix something.
Regrading the variable problem, that seems a little bit odd. How does the JSON look like that you send with the complete call. If you have the numeric value in quotation marks, that could lead to the problem that the engine first recognize it as a String.