wf_uri start_workflow アクションで "wf" 識別子として使用できます。手記: これは タスクブラウザ コンポーネントと似ていますが、特定のテンプレートに関連付けられたワークフローを個別に実行するのではなく、取得するだけです。
このアクションは、次のように使用できます。
<get_workflow_from_template id="get_workflow_from_template"> <param name="template">NameOfTemplate</param> </get_workflow_from_template>
結果処理:
<ルールid="extracted">
<expression><![CDATA[ #{event:command} == 'WORKFLOW_EXTRACTED']]></expression>
<actions>
<action id="start_workflow" type="start_workflow">
<param name="wf">#{event:payload.wf_uri}</param><
/action>
</actions>
</rule>
<rule id="extraction_error">
<expression><![CDATA[ #{event:command} == 'WORKFLOW_EXTRACTION_ERROR']]></expression>
<actions>
<finish_workflow id="finish_workflow">
<output><
param name="wf_error" type="bool">true</param><
/output><
/finish_workflow><
/actions><
/rule>
ワークフローまたはステップのパラメーターを設定または更新します。
識別子: setvar
{global::my_value} 直接参照または appcontext.global.my_value Javascript) からアクセスできるグローバル コンテキスト値を作成します。#{user_session::my_value}と同様に機能しますが、ユーザーがサインアウトすると値が削除されます。極小
<setvar id="increase_step">
<context_update>
<param name="current_step">#{current_step}+1</param>
</context_update>
</setvar>
すべてのオプション
<setvar id="next_step">
<context_of>root</context_of>
<context_update>
<param name="current_step_index" type="long">#{current_step}+1</param>
<param name="step" type="object">?{context.steps[context.current_step_index]}?</param>
</context_update>
</setvar です>
指定した 1 つ以上のアセットをダウンロードします。
識別子: download_assets
<download_assets id="test">
<asset_uris>xai:/assets/hops_02?version=1</asset_uris>
</download_assets>
<download_assets id="test">
<list name="asset_uris" listType="UNNAMED"><
elem>xai:/assets/hops_02?version=1</elem>
<elem>xai:/assets/hops_01?version=1</elem><
elem>xai:/assets/hops_03?version=1</elem>
</list><
/download_assets>
特定の遅延と期間を設定するオプションを使用してタイマーを設定します。ステップが変わると、期間またはタイマーが終了します。
識別子: タイマー
最初に 5 秒 (5000 ミリ秒) 後にイベントをトリガーし、その後は 2 秒 (2000 ミリ秒) ごとにイベントをトリガー REFRESH するタイマーを開始するには、これを使用できます。
<タイマーID =" trigger_refresh" コマンド="REFRESH" 遅延="5000" 期間="2000"/>
このアクションは、REST API を介して JSON データを取得するように設計されています。POST および GET データ要求タイプをサポートします。
識別子: rest_request
「https://myfcc.com/sampledata/enginedata」
「取得」
"$.rpm" // その他の例については、Jayway JsonPath を確認してください
\<list name="rest_params" listType="NAMED"> \<param name="serial" type="string">1337\</param> \</listです>
5000
「sensor_value」
次の JSON 構造を前提とした JsonPath について考えてみましょう。
[{
"color"="blue",
"id"=87427,
"name"="Blueforce87427",
"position"={
"datetime"="2017-07-20T13: 58: 47.947513+02: 00",
"positionX"=2722,
"positionY"=2,
"positionZ"=3980
}
}{
"color"="red",
"id"=11111,
"name"="Opfor11111",
"position"={
"datetime"="2017-07-20T13: 58: 47.947513+02: 00",
"positionX"=3222,
"positionY"=232,
"positionZ"=4000
}
}]
次の JsonPath 文字列を使用して、エンドポイントからデータを取得できます。
1. JsonPathの場合:
$[0]['名前']
2. 返される文字列:
ブルーフォース87427
3. JsonPath:
$[0]['位置']
4. 返される文字列:
[{
"datetime"="2022-07-27T13:58:47.925260+02:00,
"positionX"=2722,
"positionY"= 2,
"positionZ"= 3980
}]
5. JsonPath:
$[*]
6. 返される文字列:
両方のオブジェクトを含む配列全体
極小
<rest_request id="my_rest_test0">
<param name="rest_url" type="string">https://alex.dev.ubimax.com/sampledata/enginedata</param><
param name="request_type" type="string">POST</param><
param name="value_path" type="string">$.rpm</param><
list name="rest_params" listType="NAMED">
<param name="serial" type="string">1337</param><
/list><
/rest_request>
すべてのオプション
<rest_request id="my_rest_test0">
<param name="rest_url" type="string">https://alex.dev.ubimax.com/sampledata/enginedata</param><
param name="request_type" type="string">POST</param><
param name="value_path" type="string">$.rpm</param><
param name="repeat_every_ms" type="string">5000</param>
<param name="payload_path" type="string">myPayload</param><
list name="rest_params" listType="NAMED">
<param name="serial" type="string">1337</param><
/list><
/rest_request>
カスタマイズ可能なプロパティを含む汎用メッセージを Frontline コネクタに送信します。これらは属性によって DefaultInspectionRequestHandler.class 処理されます。
識別子: send_commit_message
注: プロパティ は内部でマップに変換され、その値は再帰的変換のコレクションにすることができます。最終的なマップは、メッセージのペイロード文字列に JSON 文字列として格納され、文字列、数値、ブール値などのプリミティブ値はプロパティ マップ フィールド内 に格納され ます。これにより、統合サービスとの通信時にメッセージが非常に柔軟になります。
コミットメッセージを送信する場合、次の 3 つの結果が考えられます。
タイムアウトは、指定された時間が経過しても応答が受信されない場合に発生します。これは、メッセージがネットワークで失われたか、サーバーが結果を処理するのに時間がかかりすぎるために発生します。
この場合のエラーは、通常、ネットワークエラーやサーバーエラーによるメッセージの送信の失敗など、予期しない動作を意味します。予期されるエラー処理 (プロセス内の無効な状態の処理など) は、正常な応答によって行われます。
すべての応答は、モダリティで send_commit_message 入力イベントを生成します。コマンドは またはRESPONSE_ERROR のいずれかです RESPONSE_OK, RESPONSE_TIMEOUT。
メッセージには、 payload 応答の追加データを含むオブジェクトが含まれています。と timeoutの場合error 、 ペイロードには、要求で使用されているものと同じ値に設定された "type" フィールドと "identifier" フィールドが含まれます。これは、必要に応じて特定の要求のエラーを識別するために使用できます。
成功した場合、これらのフィールドは存在しませんが、「status」フィールドは数値(統合サービスのハンドラーによって定義される)に設定されます。この値は、プロセスで予期されるエラーケースを処理するために使用できます。いずれの場合も、「response」フィールドに は、応答をさらに区別するために使用できる統合サービスによって定義された文字列が含まれます。
統合サービスでは、状況と応答の値に加えて、イベントとともに送り返される追加のプロパティーを定義できます。これらのプロパティは、イベント処理時にコンテキスト変数として使用できます。この例としては、エラー処理のために顧客の WMS からエラーメッセージを送り返したり、成功したコミットを処理するための追加情報を送信したりすることがあります (このフラグメントについては以下を参照してください)。
<send_commit_message id="pre_task_request" type="PRE_TASK_REQUEST" connection_timeout="600">
<properties>
<param name="group" type="string">#{group}</param>
<param name="aisle" type="string">#{aisle}</param>
</properties><
/send_commit_message>
<send_commit_message id="complete_inspection" type="COMPLETE_INSPECTION" connection_timeout="1500">
<param name="identifier">#{cockpit_id}</param>
</send_commit_message>
識別子 の値は 、タグ属性として設定するには無効です – これは、作成者の将来の反復で可能になるはずです。
<send_commit_message id="send_asset_info" type="PHOTO" connection_timeout="60">
<properties>
<param name="asset_uri" type="string">#{event:payload.media_file}</param>
<param name="order_id" type="string">?{pickOrder.name}?</param>
<param name="group_id" type="string">?{pickOrder.groups[activeGroup].label}?</param>
<param name="customer_reference">?{pickOrder.groups[activeGroup].picks[0].article.customerReference}?</param>
<param name="amount" type="string">?{pickOrder.groups[activeGroup].picks[0].amountOpen}?</param>
</properties><
/send_commit_message>
この手順例では、入力として画像アセット URI (media_file) が必要です。
<step id="send_asset" uitemplate="WAIT" persist="false" screen_lock_enabled="false" debug_mode="false">
<actions>
<action id="upload_media" type="trigger_upload_asset">
<param name="asset_uri">#{media_file}</param><
param name="delete_after_upload" type="bool">true</param>
<param name="upload_immediately" type="bool">true</param>
<param name="upload_immediately_delete_on_failure" type="bool">true</param>
</action><send_commit_message
id="send_asset_info" type="PHOTO" connection_timeout="200">
<properties><
param name="asset_uri" type="string">#{event:payload.asset_uri}</param>
<param name="asset_name" type="string">#{event:payload.asset_name}</param><
param name="asset_version" type="string">#{event:payload.asset_version}</param>
</properties><
/send_commit_message>
<ui_notification id="show_nok" type="WARN">
<duration>SHORT</duration><
message>Picture NOT OK</message><
/ui_notification>
<ui_notification id="show_upload_error" type="ERROR">
<duration>SHORT</duration>
<message>media upload failed</message><
/ui_notification>
<ui_notification id="show_commit_error" type="ERROR">
<duration>SHORT</duration><
message>Commit failed</message><
/ui_notification>
</actions>
<states>
<onresume>
<rule id="auto_exec">
<expression>1</expression><
actions>
<action ref="upload_media"/>
</actions></rule>
</onresume>
<onevent><
rule id="upload_ok"><
expression><
![CDATA[#{event(trigger_upload_asset):command} == 'OK']]><
/expression>
<actions><
action ref="send_asset_info"/>
</actions>
</rule><
rule id="upload_error">
<expression><
! [CDATA[#{event(trigger_upload_asset):command} == 'ERROR' || #{event(trigger_upload_asset):command} == 'NETWORK_ERROR' || #{event(trigger_upload_asset):command} == 'INTERNAL_ERROR']]> </式> <アクション> <action ref="show_upload_error"/> <action ref="finish"/> </アクション> </ルール> <ルール id="commit_ok_ok"> <式> <![CDATA[#{event(send_commit_message):command} == 'RESPONSE_OK' && #{event(send_commit_message):p ayload.response} == 'OK']]> </式> <アクション> <action ref="finish_workflow"/> </アクション> </ルール> <ルール id="commit_ok_nok"> <式> <![CDATA[#{event(send_commit_message):command} == 'RESPONSE_OK' && #{event(send_commit_message):p ayload.response} != 'OK']]> </式> <アクション> <action ref="show_nok"/> <アクション ref="goto_take_picture"/> </アクション> </ルール> <ルール id="commit_error_or_timeout"> <式> <![CDATA[#{event(send_commit_message):command} == 'RESPONSE_ERROR' || #{event(send_commit_message):command} == 'RESPONSE_TIMEOUT']]> </式> <アクション> <action ref="show_commit_error"/> <アクション ref="goto_take_picture"/> </アクション> </ルール> </onevent> </状態> </ステップ>
<actions>
<!--ダイアログは、エラー処理のためにコミットメッセージレスポンスによって設定された変数を参照します--><ui_dialog
id="sap_error" type="Error" title="Error"><
message><![CDATA[#{sap_message}<br>Continue to '#{sap_material}/#{sap_position}'?]]></message><
buttons><
button><
text>ANDRRES_fw</text><
command>SAP_FIX</command><
focused>true</focused><
/button><
button><
text>ANDRRES_bw</text><
command>DO_NOT_TRY_AGAIN</command><
/button>
</buttons></ui_dialog>
<!--
その他のアクション
[...]
-->
</actions><!--
より多くの WF コード
[...]
-->
<onevent>
<!--技術的には成功しましたが、SAP応答を確認します--><
rule id = "success">
<expression><![CDATA[#{event:command} == 'RESPONSE_OK' && #{event:payload.status} == 0 ]]></expression>
<actions><ui_notification
id="show_done" type="INFO">
<duration>SHORT</duration><>
message#{cockpit_id} completed...</message><
/ui_notification>
<action ref="close_ds_task"/>
<action ref="finish_workflow"/>
</actions><
/rule><
rule id="sap_error_in_success">
<expression><![CDATA[#{event:command} == 'RESPONSE_OK' && #{event:payload.status} == 500 ]]></expression>
<actions><!--
変数は、イベントが処理されるときに自動的に設定され、アクションで使用できます -->
<action ref="sap_error"/>
</actions>
</rule><
rule id="unknown_error_in_success">
<表現><![CDATA[#{event:command} == 'RESPONSE_OK' &&#{event:payload.status} != 0 && #{event:payload.status} != 500 ]]></expression>
<actions>
<action ref="completion_error"/>
</actions>
</rule><
rule id="request_error">
<expression><![CDATA[#{event:command} == 'RESPONSE_ERROR']]></expression>
<actions>
<action ref="completion_error"/>
</actions><
/rule>
<rule id="request_timeout">
<expression><! [CDATA[#{event:command} == 'RESPONSE_TIMEOUT']]></expressionです> <アクション> <action ref="completion_error"/> </アクション> </ルール> </onevent>
<send_commit_message id="send_mqtt" type="FRONTLINE_MQTT" connection_timeout="200">
<properties>
<param name="mqtt" type="string"><![CDATA[?{
var mqtt = {
topic: "MY/TOPIC",
content: "マイコンテンツ"
};
var stringmqtt = JSON.stringify(mqtt);
stringmqtt;}?]]>
</param><
/properties>
</send_commit_message>
以下は、コネクタの "Inspection" 要求ハンドラー内のコードを処理する例です。
@Override public CommitMessageResponse handleCommitMessage(CommitMessage aCommit) {
if("COMPLETE_INSPECTION".equals(aCommit.getType())) {
String evaluation = aCommit.getIdentifier();
HANDLE EVENT/
/ [CODE]
if(isSuccess) {
log.info("完了成功!");
return new CommitMessageResponse(aCommit, 0, "Success!");
}
HANDLE ERROR
CommitMessageResponse cmr = new CommitMessageResponse(aCommit, 500, "SAP Error!");
cmr.addProperties("sap_message"、cr.getMessage());'cr' はカスタムコード
に固有のオブジェクトです cmr.addProperties("sap_material", cr.getMaterial());
cmr.addProperties("sap_position", cr.getPosition());
CMRを返します;
}
その他のメッセージ
エラーケースで追加されたプロパティは、イベントが処理されるときにワークフローで使用できます。
現在のステップのタスク結果に添付ファイルを追加します。
識別子: add_attachment
注: ワークフロータグでコンポーネントのレポートを有効にする必要があります。それ以外の場合、アクションは無効になります。これを行う方法の例を次に示します。 <workflow [...] reporting="true"></workflow>
手記: また、独自のタイプを設定することもできます。
極小
<add_attachment id="add_attachment">
<param name="type" type="string">documentation-comment</param>
<param name="content" type="string">#{current_comment}</param><
/add_attachment>
すべてのオプション
<add_attachment id="document_barcode">
<param name="type" type="string">barcode-content</param>
<param name="content" type="string">#{code}</param>
<param name="override" type="bool">false</param><
/add_attachment>
特定の添付ファイルのデータ型に最後に追加された添付ファイルを取得します。
識別子: get_attachment_content
手記: また、使用可能なタイプのリストにまだ含まれていない場合は、独自の添付ファイルタイプを追加することもできます。
極小
<get_attachment_content id="get_attachment_content">
<param name="type" type="string">documentation-comment</param>
<param name="write_to" type="string">current_comment</param><
/get_attachment_content>
すべてのオプション
<get_attachment_content id="get_attachment_content">
<param name="type" type="string">documentation-comment</param><
param name="write_to" type="string">current_comment</param>
<param name="write_if_empty" type="bool">true</param><
/get_attachment_content>
モジュールの状態を変更するために使用します。たとえば、これを使用して、音声入力認識を無効にすることができます。
識別子: module_state
<module_state id="resume_speech" module_name="de.ubimax.android.speechrecognition.SpeechRecognitionModule" change_state_to="resume"/><module_state id="pause_speech" module_name="de.ubimax.android.speechrecognition.SpeechRecognitionModule" change_state_to="pause"/>
クライアントをログオフします。
識別子: logoff
<ログオフ id="myaction"/>