# Create transaction among several commands

**URL:** <https://forum.flowable.org/t/create-transaction-among-several-commands/9820>\
**Category:** Flowable Engine\
**Created:** [October 14, 2022, 11:27am UTC](https://forum.flowable.org/t/create-transaction-among-several-commands/9820 "2022-10-14T11:27:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nealsun](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/nealsun/32/2905_2.png) [@nealsun](https://forum.flowable.org/u/nealsun)\
**Post date:** [October 14, 2022, 11:27am UTC](https://forum.flowable.org/t/create-transaction-among-several-commands/9820/1 "2022-10-14T11:27:23Z")

</div>

I call several flowable service api together like below:

```auto
taskService.claim(taskId, userId);
taskService.complete(taskId, vars);

```

if `taskService.complete` fails， i need to rollback `taskService.claim` which called before. As document says that

> When you make a Flowable API call, by default, everything is synchronous and part of the same transaction. Meaning, when the method call returns, a transaction will be started and committed.

How to solve this problem, can i control the transaction in my own?
