Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Provides a NoSQL database environment for varying numbers of big entities. Because of Emakin being quite connected with XML data type, as all contents created by users are being kept primarily in XML form, using XML database is straightforwardly practical. The data stored in XML database are is held as a big whole XML chunk containing various smaller XML nodes in a tree like structure. This data can be retrieved from within server-side scripts of processes to populate forms using using XmlNode.Load$XmlRepository.Query and  and $XmlRepository.QueryXml methods and on the forms with Xml XML Database Query data source.

There are two types of XML databases used when storing XML data in Emakin; : those are process databases and a domain database.

Domain Database

For every domain hosted on Emakin, a separate XML database is created. This database is reserved only for special cases, and Emakin does not store any data by default. You can save data into your domain database by using XmlNode.Save and $XmlRepository.Save methods.

General usage examples are as follows:

  • Storing settings for processes
  • Saving important process parameters
  • Keeping pre-formatted statistics to later display in dashboard reports
  • Storing scripts that can be loaded and executed later in processes

Since this database is reserved for custom usage, there is no default root node so you have to define a unique and describing root name when saving your data.

See below for an XML example of a custom settings data. 

Code Block
languagexml
titleSettings Data
collapsetrue
<LRDictionary>
  <Definitions>
    <HRGroup Caption="Human Resources Specialist">44ed5931-eef1-48ed-8d11-1cdef1d272dd</HRGroup>
    <HRManager Caption="Human Resources Manager">126945af-5ff5-49ef-8f55-0b702ad06530</HRManager>
    <LeaveTypes>
      <LeaveType>
        <Name>Annual</Name>
        <Code>A</Code>
        <SubLeaveTypes/>
        <Name_tr>Yıllık</Name_tr>
        <IncludeOnCalculation>True</IncludeOnCalculation>
        <HasSubTypes>false</HasSubTypes>
      </LeaveType>
      <LeaveType>
        <Name>Excuse</Name>
        <Code>E</Code>
        <SubLeaveTypes>
          <SubLeaveType>
            <Id>ac9572db-7045-4a37-a170-1781d56483d3</Id>
            <Name>Sickness</Name>
            <Name_tr>Hastalık</Name_tr>
          </SubLeaveType>
          <SubLeaveType>
            <Id>23cc603f-d037-4acc-90c9-8dc26aefb05a</Id>
            <Name>Death</Name>
            <Name_tr>Vefat</Name_tr>
          </SubLeaveType>
          <SubLeaveType>
            <Id>bc1f4fbc-1b81-4e92-9daa-b91ca39af77a</Id>
            <Name>Other</Name>
            <Name_tr>Diğer</Name_tr>
          </SubLeaveType>
        </SubLeaveTypes>
        <Name_tr>Mazeret</Name_tr>
        <IncludeOnCalculation/>
        <HasSubTypes>true</HasSubTypes>
      </LeaveType>
    </LeaveTypes>
    <Calculation/>
    <Manager2Approval>True</Manager2Approval>
    <SecondManagerApprovalExcluded>
      <Identity Caption="Irmak Bardakçı" Type="" Domain="">f2767cb6-4cb5-45a8-ad0f-a01af17c2fb6</Identity>
      <Identity Caption="Bülent Yüksel" Type="" Domain="">b8e60233-7fce-4d8d-a597-acd4fd90ce05</Identity>
      <Identity Caption="Gökhan Berker" Type="" Domain="">c0d262ef-afcb-4ec5-8cba-b402ef13727b</Identity>
      <Identity Caption="Esin Kent" Type="" Domain="">38e708df-1b8f-44e2-a13f-c35fe94e5355</Identity>
      <Identity Caption="Nesrin Cevdet" Type="" Domain="">63612ed1-0bd5-49a0-a490-c37cef4e07fd</Identity>
    </SecondManagerApprovalExcluded>
    <DayCountForWeek>5</DayCountForWeek>
  </Definitions>
</LRDictionary>

In this example, settings for the Leave Request process get stored in domain database and their data is enclosed between <LRDictionary> tags as an arbitrary choice. It includes HR authorities' information, leave type definitions and their localization data, and a list of people for some exceptions depending on the design of the process. A settings screen designed in this process loads this XML data and lets users to modify it depending on their needs, which makes this process quite flexible.

Process Database

Every time a process is created in Emakin, a separate XML database is allocated for that process automatically. All the workflows running on Emakin keep their data as XML forms and whenever a workflow gets triggered from a process, its form content and an XML metadata of this workflow gets stored into the corresponding process database alongside under the root node. Any changes made on the flow automatically updates this data, for example taking an action on a task or completing a flow.

The data stored here is almost identical to the data stored in the relational database except for it being in an XML form. The key difference here is that XML data of a workflow is more compact and easier to obtain and organize to create desired reports with it. Besides retrieving these that data from SQL, data tables is are managed by Emakin's built-in functions in a resctricted restricted aspect. For this reason, using the process data stored in XML databases is more practical when generating report views depending on process data.

...

The XML metadata stored in the process database is enclosed within <Instance> tags and contains various information about the goings-on of a workflow. Instance node represents the workflow 's itself and contains a list of every work item owned. Whenever a work item belonging to a flow is completed, its XML metadata gets stored into its corresponding work items list.

Just as a work item is completed, a unique backgroud background job called "Instance Xml Database Replication" gets created for its instance and executed to write its metadata into the database. You can use Background Jobs Manager to monitor the status of these jobs.

...

Just as a work item is completed, a unique backgroud background job called "Form Data Xml Database Replication" gets created for its form and executed to write the content into the database. You can use Background Jobs Manager to monitor the status of these jobs.

See below for an XML example of the form data:

Code Block
languagexml
titleForm Data
collapsetrue
<form Id="f2e38788-9dbc-4e80-8c93-0b9410c07642">
  <ExpenseForm>
    <PersonnelInformation>
      <Owner Caption="Bülent Yüksel" Type="User" Domain="cadf027b-8cc3-41e1-b0e2-ed856a0579fa">b8e60233-7fce-4d8d-a597-acd4fd90ce05</Owner>
      <RegistryNumber>4444</RegistryNumber>
      <Department Caption="Research and Development">c647464d-3745-4373-8309-0cfa0a34ae70</Department>
      <Location Caption=""/>
    </PersonnelInformation>
    <ExpenseInformation>
      <Date>2019-03-14T11:02:09.2821462+03:00</Date>
    </ExpenseInformation>
    <ExpenseList>
      <Expense>
        <Id>2ccb89d7-b32a-478a-b481-ae393caf3100</Id>
        <Date>2019-03-06T00:00:00+03:00</Date>
        <ExpenseTypeGroup Caption="Transport">16</ExpenseTypeGroup>
        <ExpenseType Caption="Highway">1601</ExpenseType>
        <CostArea/>
        <DocumentDate/>
        <Reason>Taxi fare to customer</Reason>
        <DocumentNumber/>
        <DocumentTitle/>
        <DocumentTaxNumber/>
        <Amount>18.00</Amount>
        <Unit Caption="US Dollar">USD</Unit>
        <CrossRate>1.00</CrossRate>
        <ConvertedAmount>18</ConvertedAmount>
        <VAT Caption="8">8</VAT>
      </Expense>
    </ExpenseList>
  </ExpenseForm>
</form>

Domain Database

For every domain hosted on Emakin, a separate XML database is created. This database is reserved for only special use cases and Emakin does not store any data by default. 

General usage examples are as follows:

  • Storing settings for processes
  • Saving important process parameters
  • Keeping pre-formatted statistics to later display in dashboard reports
  • Storing scripts that can be loaded and executed later in processes

Since this database is reserved for custom usage, there is no default root node so you have to define a unique and describing root name when saving your data.

See below for an XML example of a custom settings data. 

Code Block
languagexml
titleSettings Data
collapsetrue
<LRDictionary>
  <Definitions>
    <HRGroup Caption="Human Resources Specialist">44ed5931-eef1-48ed-8d11-1cdef1d272dd</HRGroup>
    <HRManager Caption="Human Resources Manager">126945af-5ff5-49ef-8f55-0b702ad06530</HRManager>
    <LeaveTypes>
      <LeaveType>
        <Name>Annual</Name>
        <Code>A</Code>
        <SubLeaveTypes/>
        <Name_tr>Yıllık</Name_tr>
        <IncludeOnCalculation>True</IncludeOnCalculation>
        <HasSubTypes>false</HasSubTypes>
      </LeaveType>
      <LeaveType>
        <Name>Excuse</Name>
        <Code>E</Code>
        <SubLeaveTypes>
          <SubLeaveType>
            <Id>ac9572db-7045-4a37-a170-1781d56483d3</Id>
            <Name>Sickness</Name>
            <Name_tr>Hastalık</Name_tr>
          </SubLeaveType>
          <SubLeaveType>
            <Id>b2caff73-f308-4b01-979c-321dcb123056</Id>
            <Name>Paternity</Name>
            <Name_tr>Babalık</Name_tr>
          </SubLeaveType>
          <SubLeaveType>
            <Id>23cc603f-d037-4acc-90c9-8dc26aefb05a</Id>
            <Name>Death</Name>
            <Name_tr>Vefat</Name_tr>
          </SubLeaveType>
          <SubLeaveType>
            <Id>bc1f4fbc-1b81-4e92-9daa-b91ca39af77a</Id>
            <Name>Other</Name>
            <Name_tr>Diğer</Name_tr>
          </SubLeaveType>
        </SubLeaveTypes>
        <Name_tr>Mazeret</Name_tr>
        <IncludeOnCalculation/>
        <HasSubTypes>true</HasSubTypes>
      </LeaveType>
    </LeaveTypes>
    <Calculation/>
    <Manager2Approval>True</Manager2Approval>
    <SecondManagerApprovalExcluded>
      <Identity Caption="Irmak Bardakçı" Type="" Domain="">f2767cb6-4cb5-45a8-ad0f-a01af17c2fb6</Identity>
      <Identity Caption="Bülent Yüksel" Type="" Domain="">b8e60233-7fce-4d8d-a597-acd4fd90ce05</Identity>
      <Identity Caption="Gökhan Berker" Type="" Domain="">c0d262ef-afcb-4ec5-8cba-b402ef13727b</Identity>
      <Identity Caption="Esin Kent" Type="" Domain="">38e708df-1b8f-44e2-a13f-c35fe94e5355</Identity>
      <Identity Caption="Nesrin Cevdet" Type="" Domain="">63612ed1-0bd5-49a0-a490-c37cef4e07fd</Identity>
    </SecondManagerApprovalExcluded>
    <DayCountForWeek>5</DayCountForWeek>
  </Definitions>
</LRDictionary>

...