Error 405 when trying to Fetch and Lock and External process


#1

Im am running Camunda in Docker using version 7.9.0-alpha1 that runs on Apache Tomcat/8.0.47. I’m trying to use rest and external methods to have Camunda run some python scripts as part of a workflow. I’ve specified the service task as external and given it a Topic name. I then tried to see if I could access the process Through REST and I was able to get it to load using the requests library:

data = {
“topicName”:“CarryRequest”
}
url = ‘http://localhost:8080/engine-rest/external-task
headers = {“Accept”: “application/json”}
response = requests.get(url,data)

This was able to successfully load the instance and get all its information so I then tried to Fetch and lock the process so I could handle the information in Python but every time I try to fetch and lock it i get a 405 error. I’m can’t figure out why I’m getting this error and don’t know if maybe something has to be further set up in the server that I’m maybe missing or if I’m maybe performing the call incorrectly? The code I’m using is:

data = {
“workerId”:“myWorker”,
“maxTasks”:1,
“usePriority”:True,
“topics”:
[{“topicName”: “CarryRequest”,
“lockDuratison”: 10000
}]
}
url = ‘http://localhost:8080/engine-rest/external-task/fetchAndLock
headers = {“Content-Type”: “application/json”}
response = requests.post(url,data)

I have tried the header as both as Content-Type and as Accept as above as well as formatting the “data” variable in a multitude of different ways as I though maybe it wasn’t written correctly.

Also apologies if I’m not %100 clear on the issue or don’t give enough background as I am still very new to Camunda and trying to learn it. I will do my best to clarify or further explain anything needed!


#2

Hi is this a transposition typo in your post, or a problem in your code?

regards

Rob


#3

That is a transposition typo, my apologies.


#4

Is there any further information that I could provide that may help?