# Camunda External Task Client- task stuck at one state

**URL:** <https://forum.camunda.io/t/camunda-external-task-client-task-stuck-at-one-state/7865>\
**Category:** Discussion & Questions\
**Tags:** process-engine\
**Created:** [June 27, 2018, 11:02am UTC](https://forum.camunda.io/t/camunda-external-task-client-task-stuck-at-one-state/7865 "2018-06-27T11:02:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Urvashi\_Prasad](https://forum.camunda.io/user_avatar/forum.camunda.io/urvashi_prasad/32/5838_2.png) [@Urvashi\_Prasad](https://forum.camunda.io/u/Urvashi_Prasad)\
**Post date:** [June 27, 2018, 11:02am UTC](https://forum.camunda.io/t/camunda-external-task-client-task-stuck-at-one-state/7865/1 "2018-06-27T11:02:05Z")

</div>

Hi  
I was trying out the example on Camunda External Task Client ([https://github.com/camunda/camunda-external-task-client-java/tree/master/examples/loan-granting](https://github.com/camunda/camunda-external-task-client-java/tree/master/examples/loan-granting)).

I tried the above tutorial step by step. After deploying, I can see the process stuck at the first task.

But apparently the class App is not executing, coz I am not able to see the variables set during the first external task and the execution is not moving to next step.

Am I missing something here?. Why isn’t the external task executing and moving after the first step.  
I am attaching my bpmn.

[testExternal2.bpmn](https://forum.camunda.io/uploads/default/original/2X/5/5c3d5f922934eee93c2ccbcb69aaa993c17ce159.bpmn) (3.8 KB)

```
   public class App {

    	public static void main(String... args) throws InterruptedException {
    		// bootstrap the client
    		ExternalTaskClient client = ExternalTaskClient.create().baseUrl("http://localhost:8080/engine-rest").build();

    		// subscribe to the topic
    		client.subscribe("emailListener").lockDuration(1000).handler((externalTask, externalTaskService) -> {

    			// retrieve a variable from the Workflow Engine
    			int key1 = externalTask.getVariable("key1");

    			List<Integer> creditScores = new ArrayList<>(Arrays.asList(key1, 9, 1, 4, 10));

    			// create an object typed variable
    			ObjectValue creditScoresObject = Variables.objectValue(creditScores).create();
    			   // set the recently created variable
    		    externalTask.setVariableTyped("creditScores", creditScoresObject);
    			// complete the external task
    			externalTaskService.complete(externalTask);
    			// ,
    			// Collections.singletonMap("creditScores", creditScoresObject)
    			System.out.println("The External Task " + externalTask.getId() + " has been completed!");

    		}).open();
    		// subscribe to the topic
    		client.subscribe("caseCreation").lockDuration(1000).handler((externalTask, externalTaskService) -> {

    			// retrieve a variable from the Workflow Engine
    			ObjectValue creditScoresObject = externalTask.getVariable("creditScores");

    			externalTaskService.complete(externalTask);

    			System.out.println("The External Task " + externalTask.getId() + " has been completed!");

    		}).open();
    		Thread.sleep(3000);
    	}

    }
```

---

<div class="post-metadata">

**Author:** ![system](https://forum.camunda.io/uploads/default/original/3X/5/8/58d50142eacca605d35cb1ef9e6b86ae85f49436.png) [@system](https://forum.camunda.io/u/system)\
**Post date:** [January 30, 2024, 11:16am UTC](https://forum.camunda.io/t/camunda-external-task-client-task-stuck-at-one-state/7865/2 "2024-01-30T11:16:55Z")

</div>

Closed on January 30, 2024, 11:16am UTC


