# Request for help with Receive Task

**URL:** <https://forum.flowable.org/t/request-for-help-with-receive-task/5098>\
**Category:** Flowable Engine\
**Created:** [December 18, 2019, 1:46am UTC](https://forum.flowable.org/t/request-for-help-with-receive-task/5098 "2019-12-18T01:46:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sd2040](https://avatars.discourse-cdn.com/v4/letter/s/54ee81/32.png) [@sd2040](https://forum.flowable.org/u/sd2040)\
**Post date:** [December 18, 2019, 1:46am UTC](https://forum.flowable.org/t/request-for-help-with-receive-task/5098/1 "2019-12-18T01:46:51Z")

</div>

Hi Forum Members,

I am a newbie to flowable world.  
Basically , I am trying to create Receive Task which can hold the flow till triggered through API. I found through documentation that by adding triggerable=“true” in service Task that is achievable.

**bpmn20.xml**

```
  <process id="testFlow" name="Test flow" isExecutable="true">
        <startEvent id="start" />
        <sequenceFlow sourceRef="start" targetRef="testExternalInput" />

        <serviceTask id="testExternalInput" name="test the external Input" flowable:triggerable="true"
                     flowable:delegateExpression="${testExternalInputService}" />
        <sequenceFlow sourceRef="testExternalInput" targetRef="getClientProfile" />

        <serviceTask id="getClientProfile" name="Get client profile"
                     flowable:delegateExpression="${getClientProfileService}" />
        <sequenceFlow sourceRef="getClientProfile" targetRef="getLocation" />
		
		And so on...

```

When I run the flow by executing the following codes

```
ProcessInstance instance =
            runtimeService.startProcessInstanceByKey(AppConstants.PROCESS_KEY, paramMap);		

```

I see the logs (following are values from instance object).

```
2019-12-17 17:22:57 [http-nio-9000-exec-1] INFO c.o.f.o.p.s.TestExternalInputService - --------------------Inside TestTriggerableService.execute-------
2019-12-17 17:22:57 [http-nio-9000-exec-1] INFO c.o.f.o.p.service.AppFlowServiceImpl - ActivityId:null
2019-12-17 17:22:57 [http-nio-9000-exec-1] INFO c.o.f.o.p.service.AppFlowServiceImpl - ParentId:null
2019-12-17 17:22:57 [http-nio-9000-exec-1] INFO c.o.f.o.p.service.AppFlowServiceImpl - ProcessDefinitionId:prismFlow:102:99fc6980-1d40-11ea-b823-1a1dea572371
2019-12-17 17:22:57 [http-nio-9000-exec-1] INFO c.o.f.o.p.service.AppFlowServiceImpl - RootProcessInstanceId:ec14985b-2134-11ea-8f44-1a1dea572371
2019-12-17 17:22:57 [http-nio-9000-exec-1] INFO c.o.f.o.p.service.AppFlowServiceImpl - ProcessInstanceId:ec14985b-2134-11ea-8f44-1a1dea572371
2019-12-17 17:22:57 [http-nio-9000-exec-1] INFO c.o.f.o.p.service.AppFlowServiceImpl - Id:ec14985b-2134-11ea-8f44-1a1dea572371
2019-12-17 17:22:57 [http-nio-9000-exec-1] INFO c.o.f.o.p.c.ProcessController - Process Instance ID:ec14985b-2134-11ea-8f44-1a1dea572371

```

Note: I don’t know if this task is onhold/stop waiting for external trigger . Is there any field that I can print in log to identify that ?

Now when I trigger following code as external trigger with “ec14985b-2134-11ea-8f44-1a1dea572371” as parameter

```
   public String triggerServiceTask(String processInstanceId) {
    log.info("triggerServiceTask: Started.");
    String response;
  
    try {
      Execution execution =
          runtimeService.createExecutionQuery().processInstanceId(processInstanceId).singleResult();
      runtimeService.trigger(execution.getId());
      response = "success";
    } catch (FlowableObjectNotFoundException e) {
      e.printStackTrace();
      response = e.getMessage();
    }
    log.info("triggerServiceTask: response -> " + response);

    return response;
  }
}
 
 
 I get the following in log 
 
` 2019-12-17 17:30:41 [http-nio-9000-exec-5] WARN o.s.w.s.m.s.DefaultHandlerExceptionResolver - Resolved [org.springframework.web.bind.MissingServletRequestParameterException: Required String parameter 'processInstanceId' is not present]`
 
 And 
	 {
  "timestamp": "2019-12-18T01:30:41.806+0000",
  "status": 400,
  "error": "Bad Request",
  "message": "Required String parameter 'processInstanceId' is not present",
  "path": "/flow-orchestrator-prism/process/trigger-process/"
}

```

Any idea what am I missing here . Any suggestion is appreciated.

Thanks,  
-Sarad

---

<div class="post-metadata">

**Author:** ![martin.grofcik](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/martin.grofcik/32/71_2.png) [@martin.grofcik](https://forum.flowable.org/u/martin.grofcik)\
**Post date:** [December 18, 2019, 2:42pm UTC](https://forum.flowable.org/t/request-for-help-with-receive-task/5098/2 "2019-12-18T14:42:40Z")

</div>

> [@sd2040](#):
>
> “timestamp”: “2019-12-18T01:30:41.806+0000”, “status”: 400, “error”: “Bad Request”, “message”: “Required String parameter ‘processInstanceId’ is not present”, “path”: “/flow-orchestrator-prism/process/trigger-process/”

String parameter processInstanceId is missing.

```auto
runtimeService.trigger(execution.getId());

```

should trigger execution which waits on receive task.

Regards  
Martin
