Calling javascript as external resources-camunda


#1

I am trying to take decision by calling javascript as external resources on condition type Attribute.
and its routing in one direction either its true or false. below is my javascript code
var getexistingClient = execution.getVariable(“existingClient”);
var setexistingClient = execution.setVariable(“existingClient”, existingClient);

validation();
function validation(){
if (getexistingClient.equals(“Y”)) {

return true;

} else {

return false;
}

}


#2

Why don’t you test variable ?

${existingClient == ‘Y’}


#3

Also, what is your question?


#4

${existingClient == ‘Y’}
this is working fine but I want to do the validation from external resources as because I have many other variables on which i need to do validation so and variables can be changed.
so I need to do validation from external resources.


#5

Hi @abhi1o3,
I’m not javaScript expert but as far I know latest script line is treated as result and should return boolean value e.g. validation();


#6

can you tell me Rest Api for getting candidate Group name?


#7

Sorry, but I do not understand your question. How this reflect to initial topic?
Task’s candidate group (and more) can be obtained from get task operation


#8

ya this is different from above topic but i need to get the candidate group associated with user task using Rest Api


#9

Then you should close this topic and open new one.