﻿<ProcessDefinition Version="13" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <Namespaces>
    <Namespace Prefix="forms" NamespaceURI="http://schemas.emakin.com" SchemaLocation="http://schemas.emakin.com" />
  </Namespaces>
  <Pools>
    <Pool Id="fcaa77c9-0630-4ed3-b467-9dbea1f0942d" Name="Lookup Data Administration" RootElement="LookupData" DefaultForm="c26fe261-ba34-409e-b9f9-efd859243276" IsAdministrative="True" EnableActivityStream="False">
      <Tasks>
        <Task Id="471d3607-6f4d-4b9b-80eb-0deff139cbb0" Name="Manage Categories" Caption="Manage Categories" IsInitiator="True" Module="Automation">
          <Actions>
            <Action Id="4e28bb81-cb77-4a06-9829-537ab3d9e5b0" Name="Save" Caption="Save" ValidationGroup="Save" />
          </Actions>
          <PreWork>
            <Content><![CDATA[$Database.ExportToXml({
    TargetSchema: 'TutorialLookup',
    TargetTable: 'Categories',
    XPath: 'Categories/Category'
});]]></Content>
          </PreWork>
          <PostWork>
            <Content><![CDATA[$Xml.SelectAll('Categories/Category', function(category) {
    if (category.IsEmpty('Id')) {
        category.SetValue('Id', Script.NewId());
    }
});

$Database.ImportFromXml({
    TargetSchema: 'TutorialLookup',
    TargetTable: 'Categories',
    XPath: 'Categories/Category'
});]]></Content>
          </PostWork>
          <Configurations>
            <User Form="c26fe261-ba34-409e-b9f9-efd859243276" DeadlineNotify="False" AllowDefaultPrint="False" AllowForward="False" AllowDelegation="False">
              <Instructions><![CDATA[Add, update, or deactivate lookup categories, then save the table.]]></Instructions>
            </User>
          </Configurations>
        </Task>
      </Tasks>
      <Forms>
        <Form Id="c26fe261-ba34-409e-b9f9-efd859243276" Name="Category Administration" Caption="Category Administration">
          <Contents>
            <TableContent XPath="Categories" SectionName="Categories">
              <ItemXPath><![CDATA[Category]]></ItemXPath>
              <RowIdXPath><![CDATA[Id]]></RowIdXPath>
              <SortXPath><![CDATA[Code]]></SortXPath>
              <AllowMovingXPath><![CDATA[0]]></AllowMovingXPath>
              <AllowMoveUpDownXPath><![CDATA[0]]></AllowMoveUpDownXPath>
              <AllowNewXPath><![CDATA[1]]></AllowNewXPath>
              <AllowDeleteXPath><![CDATA[1]]></AllowDeleteXPath>
              <AllowDeleteAllXPath><![CDATA[0]]></AllowDeleteAllXPath>
              <AddNewLabel>
                <Content><![CDATA[Add Category]]></Content>
              </AddNewLabel>
              <Columns>
                <Column>
                  <Label>
                    <Content><![CDATA[Code]]></Content>
                  </Label>
                  <Controls>
                    <TextBox MaxLength="30" Size="Large" RequiredForGroup="Save" XPath="Code">
                      <Hints><![CDATA[Use a stable code that integrations can store.]]></Hints>
                      <PlaceHolder><![CDATA[CODE]]></PlaceHolder>
                    </TextBox>
                  </Controls>
                </Column>
                <Column>
                  <Label>
                    <Content><![CDATA[Name]]></Content>
                  </Label>
                  <Controls>
                    <TextBox MaxLength="100" Size="Large" RequiredForGroup="Save" XPath="Name">
                      <Hints><![CDATA[Enter the user-facing category name.]]></Hints>
                      <PlaceHolder><![CDATA[Category name]]></PlaceHolder>
                    </TextBox>
                  </Controls>
                </Column>
                <Column>
                  <Label>
                    <Content><![CDATA[Active]]></Content>
                  </Label>
                  <Controls>
                    <CheckBox UncheckedValue="False" XPath="Active">
                      <Label>
                        <Content><![CDATA[Available for selection]]></Content>
                      </Label>
                    </CheckBox>
                  </Controls>
                </Column>
              </Columns>
              <Editor />
            </TableContent>
          </Contents>
          <Script>
            <Content><![CDATA[]]></Content>
          </Script>
        </Form>
      </Forms>
    </Pool>
  </Pools>
  <Schemas>
    <Schema Id="13652a7e-95f1-46e3-a4a5-df5220193eeb" Name="TutorialLookup" Prefix="TutLookup">
      <Tables>
        <Table Id="88d10bf2-e599-4370-afd0-2ee45f2c1c25" Name="Categories" PrimaryKey="d0f0b409-357e-4c0f-80ee-6a6bd452d4b3" AuthorizeBy="">
          <Fields>
            <Field Id="d0f0b409-357e-4c0f-80ee-6a6bd452d4b3" Name="Id" Type="Guid" Size="10">
              <Languages />
            </Field>
            <Field Id="51cb4d7d-8b8d-44ed-a28d-66a5fe313655" Name="Code" Size="30">
              <Languages />
            </Field>
            <Field Id="15fee299-4b79-4e01-bcbc-46e0de37076a" Name="Name" Size="100">
              <Languages />
            </Field>
            <Field Id="60c27d07-8b1f-4fdb-9848-f6f45901712f" Name="Active" Type="Bit" Size="10">
              <Languages />
            </Field>
          </Fields>
        </Table>
      </Tables>
    </Schema>
  </Schemas>
  <AccessScopes />
  <Reports />
  <XmlSchemas>
    <xs:schema elementFormDefault="qualified">
      <xs:element name="LookupData">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="Categories">
              <xs:complexType>
                <xs:sequence>
                  <xs:element minOccurs="0" maxOccurs="unbounded" name="Category">
                    <xs:complexType>
                      <xs:sequence>
                        <xs:element minOccurs="0" name="Id" type="xs:string" />
                        <xs:element name="Code" type="xs:string" />
                        <xs:element name="Name" type="xs:string" />
                        <xs:element minOccurs="0" name="Active" type="xs:boolean" />
                      </xs:sequence>
                    </xs:complexType>
                  </xs:element>
                </xs:sequence>
              </xs:complexType>
            </xs:element>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
    </xs:schema>
  </XmlSchemas>
  <ExternalXmlSchemas />
  <Localization>
    <Translations>
      <Translation Name="Instructions" Entity="True">
        <Locations>
          <Location><![CDATA[//Route/Instructions]]></Location>
          <Location><![CDATA[//Task/Configurations/User/Instructions]]></Location>
        </Locations>
      </Translation>
      <Translation Name="TaskName" Entity="True">
        <Locations>
          <Location><![CDATA[//Task/@Caption]]></Location>
        </Locations>
      </Translation>
      <Translation Name="ActionName" Entity="True">
        <Locations>
          <Location><![CDATA[//Action/@Caption]]></Location>
        </Locations>
      </Translation>
      <Translation Name="DashboardName" Entity="False">
        <Locations>
          <Location><![CDATA[//Screen[@IsDashboard = 'True']/@Name]]></Location>
        </Locations>
      </Translation>
      <Translation Name="FormCaption" Entity="False">
        <Locations>
          <Location><![CDATA[//Form/@Caption]]></Location>
          <Location><![CDATA[//Screen/@Caption]]></Location>
        </Locations>
      </Translation>
      <Translation Name="Variable" Entity="True">
        <Locations>
          <Location><![CDATA[//Pool/Variables/Variable]]></Location>
        </Locations>
      </Translation>
      <Translation Name="RoleName" Entity="False">
        <Locations>
          <Location><![CDATA[//Pool/Roles/Role/@Caption]]></Location>
        </Locations>
      </Translation>
      <Translation Name="ActionConfirmation" Entity="False">
        <Locations>
          <Location><![CDATA[//Action/ConfirmationMessage]]></Location>
        </Locations>
      </Translation>
      <Translation Name="Template" Entity="False">
        <Locations>
          <Location><![CDATA[//Templates/Template/Content]]></Location>
        </Locations>
      </Translation>
      <Translation Name="TemplateSubject" Entity="False">
        <Locations>
          <Location><![CDATA[//Templates/Template/Subject]]></Location>
        </Locations>
      </Translation>
      <Translation Name="Label" Entity="True">
        <Locations>
          <Location><![CDATA[//Label/Content]]></Location>
        </Locations>
      </Translation>
      <Translation Name="Literal" Entity="False">
        <Locations>
          <Location><![CDATA[//AddNewLabel/Content]]></Location>
          <Location><![CDATA[//Column/@Caption]]></Location>
          <Location><![CDATA[//Column/Caption]]></Location>
          <Location><![CDATA[//Column/Properties/@Caption]]></Location>
          <Location><![CDATA[//DataExchange/Columns/Column/Caption]]></Location>
          <Location><![CDATA[//Footer/Content]]></Location>
          <Location><![CDATA[//LineChart/Title/Content]]></Location>
          <Location><![CDATA[//LineChart/XAxisLabel/Content]]></Location>
          <Location><![CDATA[//LineChart/YAxisLabel/Content]]></Location>
          <Location><![CDATA[//Literal/Content]]></Location>
          <Location><![CDATA[//PieChart/Title/Content]]></Location>
        </Locations>
      </Translation>
      <Translation Name="Html" Entity="False">
        <Locations>
          <Location><![CDATA[//Html/Content]]></Location>
        </Locations>
      </Translation>
      <Translation Name="XPath" Entity="False">
        <Locations>
          <Location><![CDATA[//LineChart/Lines/Line/LabelXPath]]></Location>
          <Location><![CDATA[//PieChart/Pies/Pie/LabelXPath]]></Location>
          <Location><![CDATA[//PieChart/Pies/Pie/ValueUnitXPath]]></Location>
        </Locations>
      </Translation>
      <Translation Name="FieldHint" Entity="False">
        <Locations>
          <Location><![CDATA[//Hints]]></Location>
        </Locations>
      </Translation>
      <Translation Name="PlaceHolder" Entity="False">
        <Locations>
          <Location><![CDATA[//PlaceHolder]]></Location>
        </Locations>
      </Translation>
      <Translation Name="ListItem" Entity="True">
        <Locations>
          <Location><![CDATA[//Items/Item/Text]]></Location>
        </Locations>
      </Translation>
      <Translation Name="Transforms" Entity="False">
        <Locations>
          <Location><![CDATA[//Form//Query/Columns/Column/Transforms/Transform/TransformValue]]></Location>
        </Locations>
      </Translation>
    </Translations>
    <Languages />
  </Localization>
</ProcessDefinition>