Multiple Condition

1136
5
Jump to solution
07-31-2018 08:47 AM
stevegourley
Occasional Contributor II

Is it possible to use a built-in condition like esri_map_pane combined with a custom condition? It would be natural to add the id of the esri_map_pane condition as a state within my condition.

<insertCondition id="workflow_pane_created" caption="has the workflow pane model been initialized yet?">

      <state id="workflow_pane_enabled" />

      <state id="esri_map_pane"/>

</insertCondition>

You could supply an attribute on the condition itself whether to evaluate them with a boolean and or or logic.

I have a situation where I do not want buttons to be active unless the map is active and initialized. Then I have subsequent buttons I do not want active building on the prior buttons state. Trying to do this without being able to build off of the esri provided states is a bit difficult. 

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
NarelleChedzey
Esri Contributor

Steve, 

It is possible to build complex conditions based off of a number of states.   For example

<insertCondition id="myCondition" caption="My Condition">
   <or>
      <state id="state1"/>
      <state id="state2"/>
   </or>
</insertCondition>

<insertCondition id="myCondition2" caption="My Condition 2">
   <and>
      <not>
         <state id="state1"/>
      </not>
      <not>
         <state id="state3"/>
      </not>
   </and>
</insertCondition>

You can use your own states or any of the Esri defined states in your conditions. 

To use Esri defined conditions, you need to determine their state definition.  You can accomplish this by searching for the condition in the appropriate module daml file.   For example esri_mapping_xxx condition can be found in the (install_folder)\bin\Extensions\Mapping\ADMapping.daml file. 

There are some special Esri conditions - such as esri_mapping_mapPane and esri_mapping_layoutPane that are actually states.  So yes you are able to use esri_mapping_mapPane within your own condition definitions.

Narelle

View solution in original post

0 Kudos
5 Replies
NarelleChedzey
Esri Contributor

Steve, 

It is possible to build complex conditions based off of a number of states.   For example

<insertCondition id="myCondition" caption="My Condition">
   <or>
      <state id="state1"/>
      <state id="state2"/>
   </or>
</insertCondition>

<insertCondition id="myCondition2" caption="My Condition 2">
   <and>
      <not>
         <state id="state1"/>
      </not>
      <not>
         <state id="state3"/>
      </not>
   </and>
</insertCondition>

You can use your own states or any of the Esri defined states in your conditions. 

To use Esri defined conditions, you need to determine their state definition.  You can accomplish this by searching for the condition in the appropriate module daml file.   For example esri_mapping_xxx condition can be found in the (install_folder)\bin\Extensions\Mapping\ADMapping.daml file. 

There are some special Esri conditions - such as esri_mapping_mapPane and esri_mapping_layoutPane that are actually states.  So yes you are able to use esri_mapping_mapPane within your own condition definitions.

Narelle

0 Kudos
stevegourley
Occasional Contributor II

This information needs to go in the documentation. Thank you for describing it.

0 Kudos
Wolf
by Esri Regular Contributor
Esri Regular Contributor

There is a community sample that delves into states and conditions that might be of help here:

Framework - ConditionQuery

0 Kudos
stevegourley
Occasional Contributor II
0 Kudos
NarelleChedzey
Esri Contributor

Thanks Steve.  I've already made an issue to update the states and condition documentation. 

0 Kudos