<workflow wfd_version="1.0" critical="false" reporting="true" id="05cd2204-48f9-43ba-86b4-204fd9c57341" descriptor="%WFDESC%" startstep="step_1772544656897" name="Mantenimiento de Señalización - Armario de Relés" layoutCatalogName="MyCatalog">
  <input>
    <param required="false" name="external_id" type="string"/>
  </input>
  <context>
    <param name="critical">false</param>
  </context>
  <rules>
    <rule _class=".RulePojo" id="menu_selection_377a1adf-b0df-4c14-b4b8-889c2b9eee39">
      <expression>#{event(MENU_SELECTION):command} == 'FW'</expression>
      <actions>
        <action _class=".ActionRefPojo" ref="menu_selection_377a1adf-b0df-4c14-b4b8-889c2b9eee39"/>
      </actions>
    </rule>
    <rule _class=".RulePojo" id="component_type_1c815101-3480-4d68-882b-6812a4efe910">
      <expression>2</expression>
      <actions>
        <action _class=".ActionRefPojo" ref="component_type_1c815101-3480-4d68-882b-6812a4efe910"/>
      </actions>
    </rule>
    <rule _class=".RulePojo" id="component_type_0ba0282e-2f6b-4450-bc3c-af8077d31e6c">
      <expression>((#{selected_button}=='RETURN'))</expression>
      <actions>
        <action _class=".ActionRefPojo" ref="component_type_0ba0282e-2f6b-4450-bc3c-af8077d31e6c"/>
      </actions>
    </rule>
    <rule _class=".RulePojo" id="component_type_313eb444-5db0-4fb8-9117-4abc52c66131">
      <expression>2</expression>
      <actions>
        <action _class=".ActionRefPojo" ref="component_type_313eb444-5db0-4fb8-9117-4abc52c66131"/>
      </actions>
    </rule>
    <rule _class=".RulePojo" id="finish_workflow">
      <expression>1</expression>
      <actions>
        <action _class=".ActionRefPojo" ref="finish_workflow"/>
      </actions>
    </rule>
    <rule _class=".RulePojo" id="info_menu">
      <expression>#{event(MENU_SELECTION):command} == 'MENU' || #{event:command} == 'INFO'</expression>
      <actions>
        <action _class=".ActionRefPojo" ref="start_info"/>
      </actions>
    </rule>
    <rule _class=".RulePojo" id="auto_start">
      <expression>1</expression>
      <actions>
        <action _class=".ActionRefPojo" ref="start_camera"/>
      </actions>
    </rule>
    <rule _class=".RulePojo" id="attach_displayed_content">
      <expression>1</expression>
      <actions>
        <action _class=".ActionRefPojo" ref="resolve_context"/>
        <action _class=".ActionRefPojo" ref="attach_displayed_content"/>
      </actions>
    </rule>
  </rules>
  <actions>
    <start_workflow _class=".ActionPojo" id="start_info" wf="info_menu"/>
    <finish_workflow _class=".ActionPojo" id="finish_workflow"/>
    <setvar _class=".ActionPojo" id="resolve_context">
      <context_of>step</context_of>
      <context_update>
        <param name="displayed_title" type="string">#{what}</param>
        <param name="displayed_message" type="string">#{how}</param>
        <param name="displayed_message_2" type="string" descriptor="additional step description">#{with}</param>
        <param name="displayed_video_name" type="string" descriptor="URI of video in the step">#{video_name}</param>
        <param name="displayed_img" type="string" descriptor="URI of image in the step">#{img}</param>
      </context_update>
    </setvar>
    <action _class=".ActionPojo" id="attach_displayed_content" type="add_attachment">
      <param name="content" type="string">?{
                var localData = {};
                localData["displayed_title"] = context.displayed_title;
                localData["displayed_message"] = context.displayed_message;
                localData["displayed_message_2"] = context.displayed_message_2;
                localData["displayed_video_name"] = context.displayed_video_name;
                localData["displayed_img"] = context.displayed_img;
                JSON.stringify(localData)}?</param>
      <param name="type" type="string">displayed_content</param>
      <param name="override" type="bool">true</param>
    </action>
    <step_transition _class=".ActionPojo" id="menu_selection_377a1adf-b0df-4c14-b4b8-889c2b9eee39" to="#{menu_selection_377a1adf-b0df-4c14-b4b8-889c2b9eee39}"/>
    <step_transition _class=".ActionPojo" id="component_type_1c815101-3480-4d68-882b-6812a4efe910" to="#{component_type_1c815101-3480-4d68-882b-6812a4efe910}"/>
    <step_transition _class=".ActionPojo" id="component_type_0ba0282e-2f6b-4450-bc3c-af8077d31e6c" to="#{component_type_0ba0282e-2f6b-4450-bc3c-af8077d31e6c}">
      <map name="outputs">
        <param name="selected_button" type="string">#{event:command}</param>
      </map>
    </step_transition>
    <step_transition _class=".ActionPojo" id="component_type_313eb444-5db0-4fb8-9117-4abc52c66131" to="#{component_type_313eb444-5db0-4fb8-9117-4abc52c66131}"/>
  </actions>
  <steps>
    <step id="exit" descriptor="End" uitemplate="BLANK" debug_mode="false" persist="false" screen_lock_enabled="false">
      <states>
        <onresume>
          <rule _class=".RuleRefPojo" ref="attach_displayed_content"/>
          <rule _class=".RuleRefPojo" ref="finish_workflow"/>
        </onresume>
        <onevent>
          <rule _class=".RuleRefPojo" ref="info_menu"/>
        </onevent>
      </states>
    </step>
    <step id="step_1772544656897" descriptor="Información Inicial" uitemplate="step_1772544656897_CUSTOM" debug_mode="false" persist="false" screen_lock_enabled="false">
      <states>
        <onresume>
          <rule _class=".RuleRefPojo" ref="attach_displayed_content"/>
        </onresume>
        <onevent>
          <rule _class=".RuleRefPojo" ref="info_menu"/>
          <rule _class=".RuleRefPojo" ref="menu_selection_377a1adf-b0df-4c14-b4b8-889c2b9eee39"/>
        </onevent>
      </states>
      <mapping>
        <ui_element name="WITH_TEXT">
          <param name="content" type="string">Extra</param>
        </ui_element>
        <ui_element name="MEDIA">
          <param name="content" type="string">#{video_name}</param>
        </ui_element>
        <ui_element name="WHAT_TEXT">
          <param name="content" type="string">Información Inicial</param>
        </ui_element>
        <ui_element name="IMAGE">
          <param name="content" type="string">#{img}</param>
          <param name="scale_type" type="string">#{scale_type}</param>
        </ui_element>
        <ui_element name="TOPIC">
          <param name="content" type="string">#{taskTopic}</param>
        </ui_element>
        <ui_element name="HOW_TEXT">
          <param name="content" type="string">Información requerida inicial</param>
        </ui_element>
        <ui_element name="PAGENR">
          <param name="content" type="string">#{pagenumber}</param>
        </ui_element>
        <ui_element name="MORE">
          <param name="menu_id">1</param>
        </ui_element>
        <ui_element name="FW">
          <param name="menu_id">0</param>
        </ui_element>
        <ui_element name="PAUSE_TASK">
          <param name="menu_id">4</param>
        </ui_element>
        <ui_element name="DOCUMENTATION">
          <param name="menu_id">2</param>
        </ui_element>
        <ui_element name="ASSIST">
          <param name="menu_id">3</param>
        </ui_element>
        <ui_element name="CANCEL_TASK">
          <param name="menu_id">5</param>
        </ui_element>
      </mapping>
      <context>
        <param name="how" type="string">Información requerida inicial</param>
        <param name="more_button_pause_task" type="bool">true</param>
        <param name="more_button_cancel_task" type="bool">true</param>
        <param name="with" type="string">Extra</param>
        <param name="video_name" type="string" descriptor="URI of video in the step"/>
        <param name="img" type="string">xai:/wf-editor/e71379d6-7009-4ff9-99f2-ac6446029cf3/logo+fcx.png?version=1</param>
        <param name="scale_type" type="string" descriptor="the scale type of image inside the step">FIT_CENTER</param>
        <param name="auto_play" type="bool">true</param>
        <param name="what" type="string">Información Inicial</param>
        <param name="taskTopic" type="string"/>
        <param name="pagenumber" type="string"/>
        <param name="more_button_assist" type="bool">true</param>
        <param name="step_type" type="string" descriptor="Element type in flowchart">step</param>
        <param name="more_button_documentation" type="bool">true</param>
        <param name="menu_selection_377a1adf-b0df-4c14-b4b8-889c2b9eee39" type="string">component_db492073-4201-49c0-b87b-c4cd2f8ab97f</param>
      </context>
      <handlers>
        <handler type="MoreButtonStepHandler"/>
      </handlers>
    </step>
    <step id="component_db492073-4201-49c0-b87b-c4cd2f8ab97f" descriptor="Revisión Diagrama" uitemplate="FileViewer" debug_mode="false" persist="false" screen_lock_enabled="false">
      <states>
        <onresume>
          <rule _class=".RuleRefPojo" ref="attach_displayed_content"/>
        </onresume>
        <onevent>
          <rule _class=".RuleRefPojo" ref="info_menu"/>
        </onevent>
      </states>
      <mapping>
        <ui_element name="WITH_TEXT">
          <param name="content" type="string">#{with}</param>
        </ui_element>
        <ui_element name="MEDIA">
          <param name="content" type="string">#{video_name}</param>
        </ui_element>
        <ui_element name="WHAT_TEXT">
          <param name="content" type="string">#{what}</param>
        </ui_element>
        <ui_element name="IMAGE">
          <param name="content" type="string">#{img}</param>
          <param name="scale_type" type="string">#{scale_type}</param>
        </ui_element>
        <ui_element name="TOPIC">
          <param name="content" type="string">#{taskTopic}</param>
        </ui_element>
        <ui_element name="HOW_TEXT">
          <param name="content" type="string">#{how}</param>
        </ui_element>
        <ui_element name="PAGENR">
          <param name="content" type="string">#{pagenumber}</param>
        </ui_element>
      </mapping>
      <context>
        <param name="how" type="string" descriptor="step description"/>
        <param name="more_button_pause_task" type="bool">true</param>
        <param name="more_button_cancel_task" type="bool">true</param>
        <param name="with" type="string" descriptor="additional step description"/>
        <param name="video_name" type="string" descriptor="URI of video in the step"/>
        <param name="img" type="string" descriptor="URI of image in the step"/>
        <param name="scale_type" type="string" descriptor="the scale type of image inside the step">FIT_CENTER</param>
        <param name="auto_play" type="bool">true</param>
        <param name="what" type="string" descriptor="step title"/>
        <param name="taskTopic" type="string"/>
        <param name="pagenumber" type="string"/>
        <param name="more_button_assist" type="bool">true</param>
        <param name="step_type" type="string" descriptor="Element type in flowchart">step</param>
        <param name="more_button_documentation" type="bool">true</param>
        <param name="component_type_1c815101-3480-4d68-882b-6812a4efe910" type="string">component_2aba7d4b-e9a7-495c-afa3-fa35732e74b8</param>
        <param name="component_type_0ba0282e-2f6b-4450-bc3c-af8077d31e6c" type="string">step_1772544656897</param>
      </context>
      <handlers>
        <handler type="FileViewer"/>
      </handlers>
    </step>
    <step id="component_2aba7d4b-e9a7-495c-afa3-fa35732e74b8" descriptor="Llamado xAssists" uitemplate="xAssist" debug_mode="false" persist="false" screen_lock_enabled="false">
      <states>
        <onresume>
          <rule _class=".RuleRefPojo" ref="attach_displayed_content"/>
        </onresume>
        <onevent>
          <rule _class=".RuleRefPojo" ref="info_menu"/>
        </onevent>
      </states>
      <mapping>
        <ui_element name="WITH_TEXT">
          <param name="content" type="string">#{with}</param>
        </ui_element>
        <ui_element name="MEDIA">
          <param name="content" type="string">#{video_name}</param>
        </ui_element>
        <ui_element name="WHAT_TEXT">
          <param name="content" type="string">#{what}</param>
        </ui_element>
        <ui_element name="IMAGE">
          <param name="content" type="string">#{img}</param>
          <param name="scale_type" type="string">#{scale_type}</param>
        </ui_element>
        <ui_element name="TOPIC">
          <param name="content" type="string">#{taskTopic}</param>
        </ui_element>
        <ui_element name="HOW_TEXT">
          <param name="content" type="string">#{how}</param>
        </ui_element>
        <ui_element name="PAGENR">
          <param name="content" type="string">#{pagenumber}</param>
        </ui_element>
      </mapping>
      <context>
        <param name="how" type="string" descriptor="step description"/>
        <param name="more_button_pause_task" type="bool">true</param>
        <param name="more_button_cancel_task" type="bool">true</param>
        <param name="with" type="string" descriptor="additional step description"/>
        <param name="video_name" type="string" descriptor="URI of video in the step"/>
        <param name="img" type="string" descriptor="URI of image in the step"/>
        <param name="scale_type" type="string" descriptor="the scale type of image inside the step">FIT_CENTER</param>
        <param name="auto_play" type="bool">true</param>
        <param name="what" type="string" descriptor="step title"/>
        <param name="taskTopic" type="string"/>
        <param name="pagenumber" type="string"/>
        <param name="more_button_assist" type="bool">true</param>
        <param name="step_type" type="string" descriptor="Element type in flowchart">step</param>
        <param name="more_button_documentation" type="bool">true</param>
        <param name="component_type_313eb444-5db0-4fb8-9117-4abc52c66131" type="string">exit</param>
      </context>
      <handlers>
        <handler type="xAssist"/>
      </handlers>
    </step>
  </steps>
</workflow>
