DEENESPTFRRUARHIKOZHNL

服务接口 StateMachineService

Als ara::com-Dienst modellierte Schnittstelle; Methoden/Felder werden über generierte Proxies/Skeletons aufgerufen (Parameterrichtung IN/OUT).

用户指南人工智能生成

允许控制应用程序为配置的状态机请求状态切换。
AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: e242ff13fc20 来源 未决问题(1)
译自德文指南AI 生成gemini-3.8-flash-low · 2026-10-13 · 德文原文

允许控制应用程序为配置的状态机请求状态切换。

服务接口StateMachineService由 State Management 为每个配置的状态机提供,以便SMControlApplication可以通过方法RequestTransition有针对性地请求状态切换[SWS_SM_00600],[SWS_SM_91107]。该服务在状态机的启动步骤成功处理后立即被提供,并且在确认请求时不采用 Fire-and-Forget 语义。但是,如果传入的值无效、从当前状态的转换不被允许,或者更新/恢复会话同时处于活动状态,请求将被拒绝并返回特定错误[SWS_SM_91107]。

服务接口的角色与系统上下文

服务接口StateMachineService由 Functional Cluster State Management (SM) 通过标准化服务端口提供[SWS_SM_91021]。根据形式化接口定义[SWS_SM_91022],State Management 为StateMachine的每个已配置实例实例化并提供此基于ara::com的服务[SWS_SM_00600]。

作为此接口的主要消费者,SMControlApplication通过该服务直接与状态机进行交互,以请求状态切换SWS StateManagement §9.2.2 “StateMachine service”。虽然向常规自适应应用程序通知已发生的状态主要是通过独立的服务接口StateMachineNotification进行的[SWS_SM_00665],但StateMachineService构成了用于发起转换的主动控制接口。

方法与调用语义

该接口定义了方法RequestTransition,必须由SMControlApplication调用该方法以在引用的StateMachine中引起状态更改[SWS_SM_91107]。该方法需要类型为TransitionRequestType的输入参数TransitionRequest,该参数表示基础TransitionRequestTable内所需的转换值[SWS_SM_91107],SWS StateManagement §7.x “TransitionRequestTable”。

对于RequestTransition,属性 Fire & Forget 被设置为false[SWS_SM_91107]。因此,调用应用程序会收到该请求的确定性确认。Interpretation:在ara::com代理-骨架模式内,反馈通常可能通过ara::core::Future或相应的结果对象提供,其在成功时解析,或在失败时传输特定的错误状态。 问题 Q-41fa67738672c735 (未决)

生命周期与状态依赖性

一旦成功处理ActionListItem“StartStateMachine”,为待启动的StateMachine配置的每个ara::com服务(包括StateMachineService)都必须可用并被提供(Offer)[SWS_SM_00618]。这允许SMControlApplication在成功创建状态机后立即请求转换,即使状态机此时仍在处理初始ActionListSWS StateManagement §7.x “StateMachine service interfaces - Offer”。

一旦进行用于停止相应状态机的处理,服务的提供即告终止(StopOffer)[SWS_SM_00619]。调用还受制于功能性前提条件:如果系统中当前正在运行更新会话,则原则上不允许发起状态切换[SWS_SM_91107]。

错误处理与 Application Errors

在执行RequestTransition时可能会发生特定的 Application Errors,State Management 会将其返回给调用方[SWS_SM_91107]:

  • kInvalidValue:传入的值在TransitionRequestTable中未分配给任何转换[SWS_SM_91107]。
  • kTransitionNotAllowed:从StateMachine的当前状态出发,不允许进行所请求的状态转换[SWS_SM_91107]。
  • kRecoveryTransitionOngoing:由于当前正在执行故障恢复(Recovery),请求被丢弃[SWS_SM_91107]。
  • kTransitionFailed:在执行到目标状态的转换期间发生错误[SWS_SM_91107]。
  • kOperationCanceled:请求已被中止,因为它已被更新的请求所取代[SWS_SM_91107]。
  • kUpdateInProgress:该操作被禁止,因为当前更新会话处于活动状态[SWS_SM_91107]。
通过 StateMachineService 进行转换请求的流程SMControlApplicationStateMachineServiceState ManagementUse Case: Service-BereitstellungStartStateMachine verarbeitet: OfferService()Use Case: 请求状态转换RequestTransition(TransitionRequest)Zustandswechsel verarbeitenalt成功转换根据 TransitionRequestTable 执行转换Erfolg反馈:成功Fehlerfall (z. B. kTransitionNotAllowed, kUpdateInProgress)Application Error返回错误码

时序图:通过 StateMachineService 发出转换请求的流程,包括服务提供、成功确认和错误处理。来源:[SWS_SM_91107],[SWS_SM_00618],SWS StateManagement §7.x “StateMachine service interfaces - Offer”。

本指南由 AI 基于 AUTOSAR 规范 R25-11 生成。

Mitglieder

方法

RequestTransition 服务方法

Has to be called by a SMControlApplication to request a change in the referenced StateMachine.

RequestTransition (IN TransitionRequestType TransitionRequest)

数据类型

应用错误

kInvalidValue 应用错误

The provided value is not mapped to any transition.

kOperationCanceled 应用错误

The request was replaced by a newer one and therefore it was cancelled

Request will not be carried out, because currently recovery is ongoing.

kTransitionFailed 应用错误

During transition to the requested state an error occurred.

Requested transition is not possible from current StateMachine state.

kUpdateInProgress 应用错误

Requested operation is not allowed as update session is in progress.

文档

服务方法 RequestTransition [SWS_SM_91107] Upstream: RS_SM_00001, RS_SM_00004

RequestTransition (IN TransitionRequestType TransitionRequest)

Has to be called by a SMControlApplication to request a change in the referenced StateMachine.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: e769039e5880 来源
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

使用

服务方法 RequestTransition 由接口 StateMachineService 上的 SMControlApplication 调用,以请求受引用的 StateMachine 进行状态切换([SWS_SM_91107]、SWS StateManagement §7.7 “SMControlApplication”)。传入的参数为 TransitionRequest。该方法具有返回值,且不按照发后即忘原则工作。State Management 根据当前状态通过 TransitionRequestTable 将输入值映射到后续状态([SWS_SM_00607]),并通过 SetState() 向 Execution Management 请求所产生的 Function Group States(AP EXP SWArchitecture §11.1 “Change System State”)。

错误处理

在出错时处理将中止,且 RequestTransition 返回特定的应用程序错误([SWS_SM_91107]):

  • kInvalidValue:为 TransitionRequest 传入的值未在 TransitionRequestTable 中配置([SWS_SM_00604])。
  • kTransitionNotAllowed:从 StateMachine 的当前状态出发,根据配置该转换是不允许的([SWS_SM_00603])。
  • kRecoveryTransitionOngoing:内部错误清理处于活动状态,因此不再继续处理该请求([SWS_SM_00605])。
  • kUpdateInProgress:在活动的更新会话期间不允许进行状态更改([SWS_SM_91107])。
  • kTransitionFailed:在处理 ActionListItems 时发生错误([SWS_SM_00650])。

并发性与限制

如果在针对同一 StateMachine 仍有先前的 RequestTransition 调用挂起时接受了新的转换请求,则先前的请求将被中止并以 kOperationCanceled 确认([SWS_SM_00606])。诸如 Sleep ActionListItem 等时间控制的操作不会阻塞传入的触发器;因此 RequestTransition 调用即使在此类等待时间内也能触发状态更改(SWS StateManagement §7.7.9 “ActionListItem Sleep”)。

本使用说明自动生成,且完全基于 AUTOSAR R25-11 规范。

实现者指南即将推出(复杂度 I2)

Scopeservice interface StateMachineService
Fire & Forgetfalse
Version1.0

Parameter

NameRichtungTypBeschreibung
TransitionRequestINTransitionRequestTypeRepresents the value to be used as TransitionRequest value in the Transition RequestTable.

Application Errors

FehlerBeschreibung
kInvalidValueThe provided value is not mapped to any transition.
kTransitionNotAllowedRequested transition is not possible from current StateMachine state.
kRecoveryTransitionOngoingRequest will not be carried out, because currently recovery is ongoing.
kTransitionFailedDuring transition to the requested state an error occurred.
kOperationCanceledThe request was replaced by a newer one and therefore it was cancelled
kUpdateInProgressRequested operation is not allowed as update session is in progress.

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/SWS_SM_91107
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_SM_91107@rel:R25-11#16c2f7bf
Content hash
16c2f7bf
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_StateManagement.pdf#nameddest=SWS_SM_91107
Status: valid/unmigrated Version: rel:R25-11#d4767b6b Versionshistorie & Revisions (1 transition, 3 revision)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/SWS_SM_91107@rel:R25-11#d4767b6b
Point-in-Time History:
Recorded Revisions (3):
  • R25-11rel:R25-11#a5b9b5c32026-09-30
  • R24-11rel:R24-11#75ea2a2c2026-10-14
  • R25-11rel:R25-11#d4767b6b2026-10-14 active
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill