{/* Licensed to the Apache Software Foundation (ASF) under one */}
{/* or more contributor license agreements. See the NOTICE file */}
{/* distributed with this work for additional information */}
{/* regarding copyright ownership. The ASF licenses this file */}
{/* to you under the Apache License, Version 2.0 (the */}
{/* "License"); you may not use this file except in compliance */}
{/* with the License. You may obtain a copy of the License at */}
{/*  */}
{/* http://www.apache.org/licenses/LICENSE-2.0 */}
{/*  */}
{/* Unless required by applicable law or agreed to in writing, */}
{/* software distributed under the License is distributed on an */}
{/* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY */}
{/* KIND, either express or implied. See the License for the */}
{/* specific language governing permissions and limitations */}
{/* under the License. */}

import { Meta, Story } from "@storybook/blocks";
import * as CanDrive from "./CanDrive.stories";

<Meta title="MDX/Use cases/Can drive?" of={CanDrive} />

## Can drive?

**Can drive?** is a simple example of a decision that checks if a person can drive in a specific country.
It uses a "Person" input and a "Can drive?" decision.

<p>
  <img src={"./can-drive-dmn.png"} alt="Can Drive DMN" title="Can Drive DMN" />
</p>

For this DMN, a "tPerson" data type was created. It is a structure with "Country" and "Age" values. The country is an enumeration
with three possible values: "Brazil", "US", and "England".

<p>
  <img src={"./can-drive-data-types.png"} alt="Can Drive Data Types" title="Can Drive Data Types" />
</p>

## Boxed Expression

The **Can drive?** decision uses a [Decision Table](/docs/boxed-expressions-decision-table--overview)
expression with all possible values, and therefore a **Unique**
Hit Policy. It checks the combination of the Person's Age and Country to dictate if the Person can drive or
not in its Country.

<Story of={CanDrive.Expression} />
