Error cockpit

I have a process that in the cockpit shows that I have 185 instances, some of them without any variables, which is strange because they all have to have variables, and looking at the task list they only say that there are 147, what happened with these other instances because they don’t show me the their variables?
No cockpit:
camunda1

No Task List:
camunda4

variables

Hello my friend!

How did you create the instances?

Do you have any logs or relevant information to provide us and try to help?

This usually happens when the object that camunda expects to start the instance is not passed correctly.

For example, if you are calling camunda externally, using the REST API, you must pass the data correctly such as businessKey, Variables etc… if you for example wrap the relevant data for camunda in another object, it will create an instance in Camunda without containing any data.

Example: imagine that you want to start an instance in Camunda and want to pass the businessKey and some variables… If you wrap the “businessKey” and “variables” attributes in a “data” object, the instance will be created empty. So maybe a good idea would be to check which payload is being sent when creating these “empty” instances.

William Robert Alves

Good afternoon William

Thank you for your help and collaboration, I start the instances through the REST API, follow the payload example:
data = “{variables:
{
“aa” : {“value” : “null”},
“sys_ug_notificado”: {“value” : “false”, “type”:“Boolean” },
“sys_percentual_previous” : {“value” : “0”},
“sys_qtd_anexo”: {“value” : “0”, “type”:“Integer” },
“proc_email_pf”: {“value” : " emailUG “}”
}
}”

I only send the variables, is this businessKey mandatory? Can it be the same value for all instances that are created?

Thanks for your help and time.

\o hello brother!
you’re welcome!

The businessKey is not mandatory… but I believe your problem is because you are sending a “data” object in the payload… and Camunda does not expect this. Are you passing the “data” too?

Camunda probably uses @JsonIgnore and with this, every object that is passed to Camunda that it does not recognize as a necessary object, it simply ignores.

Assemble the payload exactly like this, not forgetting the double quotes and commas.

{
    "variables": {
        "AVariable": {
            "value": "blabla",
            "type": "String"
        },
        "BVariable": {
            "value": "blabla",
            "type": "String"
        }
    }
}

William Robert Alves

Another thing I saw wrong is that…

When the type is boolean, the value must be without double quotes… that is… just true or false, not “true” or “false”.
Values of type Integer also do not use double quotes.

(Sou BR também! tamo junto! \o)

Opa BR. Vou mandar em PT_BR (nem sei se pode kkkkkk)
Então aqueles dados que envio atráves da variavel data, funciona bem ele cria as instancias e as variáveis tb, inclusive essa variável booleana cria normalmente, mas daí no cockpit me deparei com uma instancia com um incidente e quando fui pesquisar pelo id dela não entrei ela no tasklist e nem na consulta direto no banco, daí que eu vi que tinham algumas instancias no cockpit que não estavam no tasklist, no tasklits tenho rodando 147 instancias e no cockpit na mesma atividade aparecem 185. Só para exemplificar eu busco no banco, banco de outro sistema, uma lista de atividades daí faço uma interação nessa lista onde cada interação inicia uma instancia desse processo através da API REST. esta criando as instancias normalmente mas por algum motivo tb criou algumas instancias sem as variáveis e que nem aparecem no tasklist, pode ser que talvez teria que passar no payload os dados completos, pois em alguns casos mando só o nome e o valor, talvez tenha que passar o tipo, o estranho que as que não passo o tipo ele cria como String, mas enfim pode ser isso. Obrigado

Pois é… mas acho q por padrao o camunda verifica o estilo enviado, por exemplo se voce envia um payload no qual o objeto tem como valor algo com aspas duplas, ele entende que é String…
Se voce enviar algo como um numero sem aspas… entende como Integer… se enviar true ou false sem aspas… entende como Boolean.

William Robert Alves