ara::exec::StateClient is an interface of Execution Management that is used by State Management to request transitions between Function Group States or to perform other related operations. Class used to perform Function Group state management operation needed during lifetime of a Machine. State Management during its own lifetime will need to start and stop software, that is intended to run on a Machine managed by it. This can be achieved by performing state transition of a Function Group to which required software is assigned. Integrator will assign software to run in a particular state (of Function Group) and State Management can start it, by requesting Execution Management to perform state transition (of this Function Group) to the mentioned state. Execution Management will then start mentioned software and report transition result back to State Management. Please note that stopping software can be done in similar way (i.e. Function Group state transition, to a state in which software is not configured to be run).
يطلب تغييرات الحالة لمجموعات الوظائف من Execution Management للتحكم في العمليات على Machine.
مُولَّد بالذكاء الاصطناعيغير مُراجَعالنموذج: gemini-3.8-flash-medium · الجهد: medium · درجة الحرارة: غير قابل للتحكم · الموجّه: 3af3f18c3d39المصدر
مترجم من الدليل الألمانيgemini-3.8-flash-low · 2026-10-13 · الأصل الألماني
يطلب تغييرات الحالة لمجموعات الوظائف من Execution Management للتحكم في العمليات على Machine.
تتيح الواجهة ara::exec::StateClient لـ State Management طلب تغييرات الحالة لمجموعات الوظائف من Execution Management للتحكم في تنفيذ العمليات المخصصة على Machine [SWS_EM_02278]. عند الإنشاء عبر Create()، يجب تسجيل استدعاء مرجعي صالح باستمرار للحالات غير المحددة غير المتوقعة [SWS_EM_02276]. بالإضافة إلى انتقالات الحالة غير المتزامنة، توفر الفئة غير القابلة للنسخ دوال للاستعلام عن نتيجة بدء تشغيل Machine وكذلك لتحليل الأخطاء في حالة أخطاء التنفيذ [SWS_EM_02279]، [SWS_EM_02542].
السياق
تشكل الفئة ara::exec::StateClient واجهة Execution Management التي يطلب State Management من خلالها انتقالات الحالة لمجموعات الوظائف (Function Groups) ويتحكم فيها. يستخدم State Management هذا العميل طوال فترة تشغيل Machine لبدء العمليات أو إنهائها بشكل هادف. يعين مسؤول التكامل مكونات البرمجيات لحالات محددة لمجموعة وظائف. وإذا أراد State Management تنفيذ هذه البرمجيات، فإنه يطلب عبر StateClient من Execution Management الانتقال إلى حالة مجموعة الوظائف المعنية؛ ويتم الإيقاف بالمثل من خلال الانتقال إلى حالة لا ينبغي أن تكون البرمجيات فيها نشطة [SWS_EM_02278].
مخطط السياق: التفاعل بين State Management وStateClient وExecution Management. المصادر: [SWS_EM_02276]، [SWS_EM_02278]
دورة الحياة
يمكن إنشاء نسخ من StateClient إما عبر المنشئ المسمى Create()[SWS_EM_02276] كـ ara::core::Result<StateClient> أو عبر المنشئ العادي StateClient()[SWS_EM_02561]. يتطلب كلا مساري الإنشاء إلزاميًا معامل استدعاء مرجعي undefinedStateCallback من النوع std::function<void(const ara::exec::ExecutionErrorEvent&)>. يتم إطلاق هذا الاستدعاء المرجعي بواسطة مكتبة StateClient عندما تنتقل مجموعة وظائف بشكل غير متوقع ودون طلب مسبق بواسطة SetState() إلى حالة غير محددة. يجب على المتصل التأكد من بقاء هذا الاستدعاء المرجعي قابلاً للاستدعاء طوال فترة بقاء نسخة StateClient، وهو أمر مهم بشكل خاص عند ربط الكائنات عبر std::bind[SWS_EM_02276]، [SWS_EM_02561].
تنقسم دورة التطبيق النموذجية إلى التهيئة، واستعلام نتيجة بدء التشغيل، وتغييرات الحالة المنتظمة، ومراقبة الأخطاء:
الإنشاء: يُنشئ State Management نسخة من StateClient مع تحديد دالة استدعاء رجعي صالحة للإبلاغ عن الأخطاء عبر Create()[SWS_EM_02276].
استعلام نتيجة بدء التشغيل الأولية: يطلب State Management باستخدام GetInitialMachineStateTransitionResult() نتيجة انتقال الحالة الأولي إلى حالة بدء التشغيل [SWS_EM_02279]. وبما أن هذا الانتقال يحدث لمرة واحدة فقط لكل دورة حياة للـ Machine، فإن ara::core::Future<void> المُقدَّم يظل مستقرًا ولا يتغير حتى إعادة التشغيل.
طلب تغيير الحالة: يطلب State Management باستخدام SetState() انتقالات حالة غير متزامنة لمجموعات وظيفية فردية [SWS_EM_02278]. وتعود الطريقة على الفور وتقدم ara::core::Future<void> للاستعلام عن الاكتمال. وبمجرد استلام الطلب لدى Execution Management، يتم تنفيذه بصرف النظر عن فترة بقاء النسخة المستدعية الإضافية.
فحص حالات الخطأ: إذا دخلت مجموعة وظيفية بصورة غير متوقعة في حالة غير معرَّفة، فيمكن عبر GetExecutionError() تحديد خطأ التنفيذ المتسبب في صورة ara::exec::ExecutionErrorEvent[SWS_EM_02542].
تُبلّغ عمليات الفئة عن حالات الفشل عبر رموز أخطاء ExecErrorDomain:
ExecErrc::kNoCommunication: يُشير إلى اضطرابات في الاتصال مع Execution Management، على سبيل المثال عند انقطاع اتصال IPC. يحدث عند Create()[SWS_EM_02276]، وSetState()[SWS_EM_02278]، وGetInitialMachineStateTransitionResult()[SWS_EM_02279]، وكذلك GetExecutionError()[SWS_EM_02542]. وتتمثل عملية الاستعادة المقررة في إعادة الاستدعاء.
ExecErrc::kInvalidArgument: يتم الإبلاغ عنه بواسطة Create() وStateClient()، في حال لم تكن دالة الاستدعاء الرجعي الممررة تحتوي على دالة قابلة للاستدعاء [SWS_EM_02276]، [SWS_EM_02561].
ExecErrc::kOperationCanceled: يُشير عند SetState() إلى أنه تم إلغاء انتقال قيد التشغيل بواسطة طلب أحدث [SWS_EM_02278]. وعند GetInitialMachineStateTransitionResult() يحدث هذا الخطأ إذا تم إلغاء انتقال البدء الأولي، كأن يكون ذلك بسبب انقطاع تسلسل تحديث Machine [SWS_EM_02279].
ExecErrc::kInvalidTransition: انتقال الحالة المطلوب غير مسموح به، على سبيل المثال الانتقال إلى حالة Off لـ MachineFG، أو أن الحالة لم تعد موجودة بعد التحديث [SWS_EM_02278].
ExecErrc::kInvalidMetaModelIdentifier: الحالة الممررة غير موجودة في البيان (manifest) المعالج أو أن العملية لا تمتلك تعيينًا إلى المجموعة الوظيفية المعنية [SWS_EM_02278]، [SWS_EM_02542]. وإذا حدث هذا الخطأ عند GetInitialMachineStateTransitionResult()، فإن العملية تفتقر إلى التعيين لـ MachineFG، مما يشير إلى مشكلة في التكوين [SWS_EM_02279].
ExecErrc::kOperationFailed: فشل الانتقال [SWS_EM_02278]. وعند GetExecutionError() يُشير الرمز إلى أن المجموعة الوظيفية ليست في حالة غير معرَّفة وأن المشكلة قد تم حلها على الأرجح بالفعل [SWS_EM_02542].
ExecErrc::kIntegrityOrAuthenticityCheckFailed وExecErrc::kUnexpectedTermination: حالات فشل محددة أثناء SetState() نتيجة لفشل اختبارات السلامة أو الإنهاء غير المتوقع للعملية أثناء الانتقال [SWS_EM_02278].
يستند هذا الدليل حصريًا إلى متطلبات مواصفات AUTOSAR Adaptive R25-11.
Returns the execution error which changed the Function Group of the given Function Group State to an Undefined Function Group State. This function will return with error and will not return an ExecutionErrorEvent object, if the Function Group is in a defined Function Group state again.
Method to request state transition for a single Function Group. This method will request Execution Management to perform state transition and return immediately. Returned ara::core::Future can be used to determine result of requested transition.
مُولَّد بالذكاء الاصطناعيغير مُراجَعالنموذج: gemini-3.8-flash-medium · الجهد: medium · درجة الحرارة: غير قابل للتحكم · الموجّه: 86cbb8f72d61المصدرأسئلة مفتوحة (1)
مترجم من الدليل الألمانيgemini-3.8-flash-low · 2026-10-13 · الأصل الألماني
تُستخدم دالة المصنع الثابتة Create كمنشئ مسمى (Named Constructor) لإنشاء مثيل لـ ara::exec::StateClient ([SWS_EM_02276]). ويتم تمرير undefinedStateCallback كمعامل إلزامي. ويتم إطلاق هذا الاستدعاء الراجع بواسطة مكتبة العميل عندما تنتقل مجموعة وظائف بشكل غير متوقع – أي بدون طلب مسبق عبر SetState() – إلى حالة غير محددة ([SWS_EM_02276]). وفي هذه الحالة، يتم إرسال مجموعة الوظائف المتأثرة والخطأ عبر ExecutionErrorEvent إلى الاستدعاء الراجع.
تنطبق شروط إطارية ثابتة على سياق الاستدعاء وفترة البقاء:
الدالة آمنة لخيوط المعالجة (thread-safe)، وآمنة من حيث الاستثناءات (exception-safe)، ومصرح عنها كـ noexcept ([SWS_EM_02276]).
يجب أن يظل undefinedStateCallback الممرر قابلاً للاستدعاء طوال فترة بقاء مثيل StateClient المنشأ ([SWS_EM_02276]). ويتطلب ذلك عناية خاصة عند الربط بمثيل كائن (على سبيل المثال بواسطة std::bind).
تتم عملية إنشاء المثيل بشكل متزامن وتُرجع ara::core::Result<StateClient> ([SWS_EM_02276]). وفي حالة حدوث خطأ، يتم تحديد رموز الخطأ التالية:
ara::exec::ExecErrc::kInvalidArgument: يُبلّغ عنه عندما لا تتضمن المعاملة المُمرّرة دالة قابلة للاستدعاء (دلالات التراجع؛ وتتم المعالجة من خلال توفير دالة صالحة) ([SWS_EM_02276]).
ara::exec::ExecErrc::kNoCommunication: يُشير إلى خطأ في الاتصال (دلالات عدم التراجع؛ وتتم المعالجة عبر إعادة المحاولة) ([SWS_EM_02276]). يُرجّح أن يعود ذلك إلى فشل إنشاء الاتصال ببيئة التنفيذ. سؤال Q-c312c2b5e7c3c7d0 (مفتوح)
يتطابق نمط التصميم بنيويًا مع أسلوب التهيئة لعملاء التنفيذ ذوي الصلة مثل ara::exec::ExecutionClient ([SWS_EM_02562])، والذي يتم إنشاؤه أيضًا مع رد نداء إلزامي عبر منشئ مسمى (Named Constructor).
تم إنشاء ملاحظة الاستخدام هذه تلقائيًا بناءً على بيانات مواصفات AUTOSAR R25-11.
callback to be invoked by StateClient library if a FunctionGroup changes its state unexpectedly to an Undefined Function Group State, i.e. without previous request by SetState(). The affected FunctionGroup and ExecutionError is provided as an argument to the callback in form of ExecutionErrorEvent. Lifetime: it is expected that undefinedStateCallback remains callable, during entire lifetime of the StateClient instance. This is especially important if, undefinedStateCallback is bound to an instance of a class (e.g. using std::bind).
Returns the execution error which changed the Function Group of the given Function Group State to an Undefined Function Group State. This function will return with error and will not return an ExecutionErrorEvent object, if the Function Group is in a defined Function Group state again.
rollback_semantics The Function Group of the given Function Group State is not in an Undefined Function Group State. Recovery: Function should only be called, if the given function group is in an undefined function group state. The problem has likely already been resolved.
rollback_semantics The given Function Group State couldn’t be found in the Processed Manifest or Process does not have a mapping to the Function Group of the given Function Group State. Recovery: Call function with a different argument
Request a governed re-review of this record. The record is not changed immediately.
rollback_semantics StateManagement may decide to cancel [SWS_EM_01023] transition and start specific startup sequence. This could happen for number of reasons and one of them could be interrupted Machine update sequence. Recovery: Call SetState again with initial state
rollback_semantics Process does not have a mapping to MachineFG. Recovery: Indicates configuration problem (should never happen)
Hinweise: This method allows State Management to retrieve the result of a transition specified by [SWS_EM_01023] and [SWS_EM_02241]. Please note that this transition happens once per machine life cycle, thus the result delivered by this method shall not change (unless machine is started again). Please note that concerns about returned ara::core::Future from ara::exec:: StateClient::SetState apply for ara::exec::StateClient:: GetInitialMachineStateTransitionResult.
Request a governed re-review of this record. The record is not changed immediately.
Method to request state transition for a single Function Group. This method will request Execution Management to perform state transition and return immediately. Returned ara::core::Future can be used to determine result of requested transition.
مُولَّد بالذكاء الاصطناعيغير مُراجَعالنموذج: gemini-3.8-flash-medium · الجهد: medium · درجة الحرارة: غير قابل للتحكم · الموجّه: b3951f2f28ceالمصدر
مترجم من الدليل الألمانيgemini-3.8-flash-low · 2026-10-13 · الأصل الألماني
تُستخدم الطريقة SetState لطلب انتقال الحالة لمجموعة وظائف مفردة من Execution Management [SWS_EM_02278]. ويتم الاستدعاء بشكل غير متزامن: تطلق الطريقة عملية التغيير وتعود فورًا بـ ara::core::Future<void>، والذي يمكن عبره تحديد نتيجة الانتقال [SWS_EM_02278]. ويُمرَّر كمعامل FunctionGroupState يحدد الحالة الهدف داخل مجموعة الوظائف بما يتوافق مع النموذج الفوقي [SWS_EM_02278].
إذا فشل الانتقال، يُرجع Future خطأً من نطاق الخطأ ErrorDomain الخاص بـ Exec[SWS_EM_02278]. تنطبق دلالات التراجع (Rollback) عند ara::exec::ExecErrc::kInvalidTransition (على سبيل المثال عند الانتقالات المحظورة مثل حالة Off لـ MachineFG) وعند ara::exec::ExecErrc::kInvalidMetaModelIdentifier (في حال غياب التعيين أو غياب التعريف في البيان) [SWS_EM_02278]. ودون دلالات التراجع، يتم الإبلاغ عن kOperationCanceled (تمت إزاحته بواسطة طلب أحدث)، وkOperationFailed، وkNoCommunication (عطل في اتصال IPC)، وkIntegrityOrAuthenticityCheckFailed، بالإضافة إلى kUnexpectedTermination[SWS_EM_02278].
الطريقة آمنة خيطيًا (thread-safe) وآمنة من الاستثناءات (exception safe) (noexcept) [SWS_EM_02278]. يعتمد ara::core::Future المُرجَع على دورة حياة المثيل المستدعي؛ وفي المقابل، يعالج Execution Management الطلب الوارد بصورة مستقلة عن دورة حياة مثيل StateClient[SWS_EM_02278].
بالتكامل مع إنشاء المثيل عبر Create[SWS_EM_02276] أو المنشئ [SWS_EM_02561]، يعترض undefinedStateCallback تغييرات الحالة غير المتوقعة التي تحدث دون استدعاء مسبق لـ SetState. ويمكن الاستعلام عن نتيجة الانتقال الأولي إلى حالة Startup بصورة منفصلة عبر GetInitialMachineStateTransitionResult[SWS_EM_02279].
أُنشئ هذا النص بواسطة ذكاء اصطناعي؛ وتتم مراجعة صحته بواسطة محرر.
representing meta-model definition of a state inside a specific Function Group. Execution Management will perform state transition from the current state to the state identified by this parameter.
no_rollback_semantics if transition to the requested Function Group state was cancelled by a newer request. Recovery: Try again (error is informative, does not indicate a problem)
rollback_semantics if transition to the requested state is prohibited (e.g. Off state for MachineFG) or the requested Function Group State is invalid (e.g. does not exist anymore after a software update). Recovery: Eventually try transition to another state
rollback_semantics The given Function Group State couldn’t be found in the Processed Manifest or Process does not have a mapping to the Function Group of the requested Function Group State. Recovery: transition to another state
Hinweise: Asynchronous nature of ara::exec::StateClient::SetState makes the returned ara:: core::Future dependable on lifetime of the instance from which it was received. It is expected that once state change request is received by Execution Management, it will be processed independently of lifetime of the instance from which it was requested. Please note that the qualified short names representing Function Groups and Function Group States could be quite long. They can be replaced by implementation specific data types to speed up any checks that have to be performed by the ara::exec::StateClient:: SetState method. This is enabled by the ara::exec::FunctionGroupState data-type.
Request a governed re-review of this record. The record is not changed immediately.
callback to be invoked by StateClient library if a FunctionGroup changes its state unexpectedly to an Undefined Function Group State, i.e. without previous request by SetState(). The affected FunctionGroup and ExecutionError is provided as an argument to the callback in form of ExecutionErrorEvent Lifetime: it is expected that undefinedStateCallback remains callable, during entire lifetime of the StateClient instance. This is especially important if, undefinedStateCallback is bound to an instance of a class (e.g. using std::bind).
gemini-3.8-flash-low· 2026-10-13 · الأصل الألماني