Project Templates

Project Templates

Project Templates

Project templates facilitate the creation of new projects with a predetermined structure, ideal for projects that require a specific file set or dependency configuration. Project templates are a type of component and follow the same creation and deployment procedures as other components.

Creating a Project Template

Create a project template using YAML as follows:

slug: my-project-template
orgSlug: kodexa-demo
version: 1.0.0
name: My Project Template
type: projectTemplate

The foundational details include slug, orgSlug, version, name, and type.

Adding Components

Incorporate components into your project template by appending sections to the YAML file:

slug: my-project-template
orgSlug: kodexa-demo
version: 1.0.0
name: My Project Template
type: projectTemplate
stores:
  - slug: "${project.id}-processing"
    name: "Documents"
    description: "Documents for ${project.name}"
    storeType: DOCUMENT
    storePurpose: OPERATIONAL
taxonomies: []
assistants:
  - name: PDF Assistant
    description: Reviews historical documents to identify key data for CDAD
    assistantDefinitionRef: kodexa/pdf-parsing-assistant
    subscription: "!hasMixins('spatial')"
    stores:
      - "${orgSlug}/${project.id}-processing:1.0.0"
    options: {}

Sections available for defining stores, taxonomies, and assistants. To create a component, detail all necessary information or reference an existing component using the ref property.

taxonomies:
  - ref: "kodexa-demo/customer-taxonomy:1.0.0"

Working with Assistants

Project templates also involve setting up assistants.

Assistant Connections

Define connections for an assistant using the connections property, which specifies the events to respond to and their associated resources.

⚠️ NOTE ⚠️

Subscriptions were introduced in version 6.3 and will supersede "stores" and "subscription" in Kodexa version 7.

Here's an example of a store subscription in the updated 6.3 format:

assistants:
  - name: PDF Assistant
    description: Reviews historical documents to identify key data for CDAD
    assistantDefinitionRef: kodexa/pdf-parsing-assistant
    connections:
    -  sourceType: STORE
       sourceRef: "${orgSlug}/${project.id}-processing:1.0.0"
       subscription: "!hasMixins('spatial')"

Kodexa recognizes these event types:

  • STORE - Triggers the assistant when a document is added to the connected store.
  • DOCUMENT_FAMILY - Triggers when a document family is updated.
  • DATA_OBJECT - Triggers when the connected data object is updated.
  • CHANNEL - Triggers when a message is received on the connected channel.
  • WORKSPACE - Triggers when the workspace is updated with the save method.

For CHANNEL or WORKSPACE connections, providing the ref is not necessary as the assistant connects based on its project association

Workspaces

You can also define workspaces. The options can be set using availablePanels, which controls the panels on the left. To display a panel, you must explicitly set it to true.

workspaces:
  - name: Document Workspace
    description: Upload, review, train and apply the model to new documents
    workspaceStorage:
      availablePanels:
        documentStores: true
        taxonomies: true
        dataForms: true
      overview: |-
        # Welcome to your Workspace

       Open a data form or document from the pane on the left to start using the Power of Kodexa.

To add a panel, call its id under availablePanels. Here are the options:

const availablePanels = ref([
    { name: "Assistants", id: "assistants" },
    { name: "Document Stores", id: "documentStores" },
    { name: "Data Forms", id: "dataForms" },
    { name: "Properties", id: "properties" },
    { name: "Exceptions", id: "exceptions" },
    { name: "Insights", id: "insights" },
    { name: "Taxonomy", id: "taxonomies" },
    { name: "Chats", id: "channelsalessale" },
    { name: "Guidance", id: "guidance" },
    { name: "Audit Trail", id: "auditEvents" },
    { name: "Navigation", id: "navigation" },
    { name: "Audit Events", id: "auditEvents" },
  ]);

Make sure you deploy the project template YAML to the model. The changes only affect the workspace of new projects; existing ones remain unaffected by the model update. If you have Show Developer Tools active, a Workspace Configuration panel will be available for use. Here, you can select the panels you wish to have available in a workspace.