1# @ohos.app.ability.AtomicServiceOptions (AtomicServiceOptions)
2
3**AtomicServiceOptions** is used as an input parameter of [openAtomicService()](js-apis-inner-application-uiAbilityContext.md#uiabilitycontextopenatomicservice12) to carry arguments. It inherits from [StartOptions](js-apis-app-ability-startOptions.md).
4
5> **NOTE**
6>
7> The initial APIs of this module are supported since API version 12. Newly added APIs will be marked with a superscript to indicate their earliest API version.
8>
9> The APIs of this module can be used only in the stage model.
10
11## Modules to Import
12
13```ts
14import { AtomicServiceOptions } from '@kit.AbilityKit';
15```
16
17## Properties
18
19**Atomic service API**: This API can be used in atomic services since API version 12.
20
21**System capability**: SystemCapability.Ability.AbilityRuntime.Core
22
23| Name| Type| Read Only| Optional| Description|
24| -------- | -------- | -------- | -------- | -------- |
25| [flags](js-apis-app-ability-wantConstant.md#flags) | number | No|  Yes| Mode in which the system processes the startup.<br>For example, **wantConstant.Flags.FLAG_INSTALL_ON_DEMAND** indicates that the installation-free capability is used.|
26| parameters | Record\<string, Object> | No|  Yes| Additional parameters. For details, see the **parameters** field in [Want](js-apis-app-ability-want.md).|
27
28**Example**
29
30```ts
31import { UIAbility, AtomicServiceOptions, common, wantConstant } from '@kit.AbilityKit';
32import { BusinessError } from '@kit.BasicServicesKit';
33
34export default class EntryAbility extends UIAbility {
35  onForeground() {
36    let appId: string = '6918661953712445909';
37    let options: AtomicServiceOptions = {
38      flags: wantConstant.Flags.FLAG_INSTALL_ON_DEMAND,
39      parameters: {
40        "demo.result": 123456
41      }
42    };
43
44    try {
45      this.context.openAtomicService(appId, options)
46        .then((result: common.AbilityResult) => {
47          // Carry out normal service processing.
48          console.info('openAtomicService succeed');
49        })
50        .catch((err: BusinessError) => {
51          // Process service logic errors.
52          console.error(`openAtomicService failed, code is ${err.code}, message is ${err.message}`);
53        });
54    } catch (err) {
55      // Process input parameter errors.
56      let code = (err as BusinessError).code;
57      let message = (err as BusinessError).message;
58      console.error(`openAtomicService failed, code is ${code}, message is ${message}`);
59    }
60  }
61}
62```
63