简体   繁体   中英

Can we use only initialstate and null state in Buildgraph method of caa?

我们可以只使用初始状态和空状态吗?如果是,它将如何表现?

As stated in the encyclopedia

The command is never in the initial state that automatically skips to the first state.

But when you read further (in the code example) :

CATDialogState *stStartState = GetInitialState("stStartPointId");

These are not the same states. In other words, GetInitialState returns you the first working state of your diagram (that will be reached automatically at command activation from the initial state) that can be associated with agents, be the source or target of any transition, as any other state that you further create with AddDialogState

You will have to reconsider your question then.

  • can I have a command with the first state and null : yes . It could be a single user action command like selecting something, that leads to the null state, or associated with a dialog : the transition would loop on the first state as long as the user keeps selecting valid stuff, that would for example be displayed in a dialog's field, then the user would choose OK or Cancel, leading to null or cancel state
  • can I have a command with the initial state and null : no . Since you wouldn't be able to create any transition, as you never have a way to manipulate that initial state.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM