Checking for Variable Type


#1

I’m a newbie in Camunda and recently began a project. What I want to do currently is check what type of variable the user has inputted and using this info, execute a certain function that uses that variable. The two possible types the user could input would be numeric or string in my case. Is there a way to check this through an external task method or is there an expression to use within the modeler sequence flow? If so, is there an example I can reference to?

Any help is appreciated, thank you.


#2

So, a user enters a single variable, and this variable’s type is determined by the user?
Why not create a different variable for each type?


#3

Due to a previous problem, I had to call them the same variable in order for a three-way gateway flow to work. When I had separate variables, it wouldn’t perform the external task I assigned it.

To get a better idea of what I’m trying to do, I’ve included what I have so far for my modeler flow. The variable the user can input could either be a name or an ID, but in order for me to return the BA info, I need to know if what I get is a string or a number.


#4

This seems like a really weird problem - There’s no reason why that should happen. What was going wrong exactly and what where your trying to do?


#5

At first, I was trying to allow the user to input yes, no or only the actual BA ID before the gateway. I checked for the boolean values of the variable decisionBool in the first two flows and the default flow would be where the BA ID was inputted, which was the variable businessAccID, then that ID is outputted back. However, I kept getting this error on my console:
camunda.CamundaClientException: Internal Server Error at camunda.CamundaClient.handleError(CamundaClient.java:26) at camunda.TaskClient.completeTask(TaskClient.java:56) at com.wf.symphony.listener.DBListener.onIMMessage(DBListener.java:100) at services.DatafeedEventsService.handleEvents(DatafeedEventsService.java:167) at services.DatafeedEventsService.lambda$null$2(DatafeedEventsService.java:102) at java.util.concurrent.CompletableFuture.uniApply(CompletableFuture.java:602) at java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:577) at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:474) at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1595) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) 500

In the Cockpit, the variable was retrieved and given its value but it wouldn’t move past the user task. Then I changed the businessAccID into decisionBool, and it worked.


#6

can you upload your process model - sounds like you’ve made some mistakes somewhere that doesn’t sounds like it be a hard thing to implement with the engine,
That error you posted - where was it thrown by an external task or by the engine itself?


#7

Here is the model that I started with. It was where I ran my war file, so I think it was by the external task.
DSOM-lights.bpmn (7.9 KB)