Notebook Blokbewerkingen

Maak en beheer analyseblokken binnen notebooks. Blokken zijn de bouwstenen van analysewerkstromen.


Bloktypen

Type Beschrijving
Filter Beperk data tot specifieke gevallen of gebeurtenissen
Calculator Bereken maatstaven, duur en afgeleide waarden
Opportunity Identificeer verbeterkansen
Insight Genereer visualisaties en statistieken
Dashboard Maak deelbare rapportpanelen aan
Alert Definieer monitoringsmeldingen

Blokken Lijst

GET /api/{tenantId}/{projectId}/notebook/{notebookId}/blocks

Geeft alle blokken in een notebook terug in uitvoeringsvolgorde.

Padparameters

Parameter Type Vereist Beschrijving
tenantId GUID Ja De tenant identificatie
projectId GUID Ja De project identificatie
notebookId GUID Ja De notebook identificatie

Response (200 OK)

{
  "notebookId": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
  "blocks": [
    {
      "blockId": "11111111-1111-1111-1111-111111111111",
      "blockType": "Filter",
      "operatorName": "ActivityFilter",
      "name": "Select Key Activities",
      "description": "Filter to main process activities",
      "parentId": null,
      "order": 0,
      "configuration": "{\"activities\": [\"Create Order\", \"Approve\", \"Ship\"]}",
      "dateCreated": "2024-01-15T10:30:00Z",
      "createdBy": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "dateModified": "2024-01-15T10:30:00Z",
      "isActive": true
    },
    {
      "blockId": "22222222-2222-2222-2222-222222222222",
      "blockType": "Calculator",
      "operatorName": "DurationCalculator",
      "name": "Case Duration",
      "description": "Calculate total case duration",
      "parentId": "11111111-1111-1111-1111-111111111111",
      "order": 0,
      "configuration": "{\"unit\": \"days\"}",
      "dateCreated": "2024-01-15T10:35:00Z",
      "createdBy": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "dateModified": "2024-01-15T10:35:00Z",
      "isActive": true
    }
  ],
  "totalCount": 2
}

Blokvelden

Veld Type Beschrijving
blockId GUID Unieke blokidentificatie
blockType string Type (Filter, Calculator, etc.)
operatorName string Specifieke operatornaam
name string Weergavenaam van het blok
description string Blokbeschrijving
parentId GUID Oudere blok-ID (data stroomt van ouder)
order integer Hint voor uitvoeringsvolgorde
configuration string JSON-configuratie voor de operator
dateCreated datetime Aanmaakdatum en -tijd
createdBy GUID ID van de maker
dateModified datetime Datum en tijd van laatste wijziging
isActive boolean Of het blok ingeschakeld is

Blok Maken

POST /api/{tenantId}/{projectId}/notebook/{notebookId}/blocks

Maakt een nieuw analyseblok aan in het notebook.

Padparameters

Parameter Type Vereist Beschrijving
tenantId GUID Ja De tenant identificatie
projectId GUID Ja De project identificatie
notebookId GUID Ja De notebook identificatie

Request Body

{
  "blockType": "Filter",
  "operatorName": "ActivityFilter",
  "name": "Filter by Status",
  "description": "Keep only completed orders",
  "configuration": "{\"activities\": [\"Complete\", \"Shipped\"]}",
  "insertAfterBlockId": "11111111-1111-1111-1111-111111111111"
}

Request Velden

Veld Type Vereist Beschrijving
blockType string Nee Type (Filter, Calculator, etc.) Standaard: Filter
operatorName string Ja Specifieke operator die gebruikt wordt
name string Ja Weergavenaam van het blok
description string Nee Blokbeschrijving
configuration string Nee JSON-configuratie voor de operator
insertAfterBlockId GUID Nee Invoegen na dit blok (standaard: einde)

Response (201 Created)

{
  "blockId": "33333333-3333-3333-3333-333333333333",
  "blockType": "Filter",
  "operatorName": "ActivityFilter",
  "name": "Filter by Status",
  "description": "Keep only completed orders",
  "parentId": "11111111-1111-1111-1111-111111111111",
  "order": 0,
  "configuration": "{\"activities\": [\"Complete\", \"Shipped\"]}",
  "dateCreated": "2024-03-01T10:00:00Z",
  "createdBy": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "dateModified": "2024-03-01T10:00:00Z",
  "isActive": true
}

Blokvolgorde Ophalen

GET /api/{tenantId}/{projectId}/notebook/{notebookId}/blocks/order

Geeft de huidige uitvoeringsvolgorde van blokken terug.

Response (200 OK)

{
  "notebookId": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
  "blockCount": 3,
  "blockOrder": [
    {
      "blockId": "11111111-1111-1111-1111-111111111111",
      "parentId": null,
      "position": 1
    },
    {
      "blockId": "22222222-2222-2222-2222-222222222222",
      "parentId": "11111111-1111-1111-1111-111111111111",
      "position": 2
    },
    {
      "blockId": "33333333-3333-3333-3333-333333333333",
      "parentId": "22222222-2222-2222-2222-222222222222",
      "position": 3
    }
  ]
}

Blokken Herordenen

PUT /api/{tenantId}/{projectId}/notebook/{notebookId}/blocks/order

Wijzigt de uitvoeringsvolgorde van blokken in het notebook.

Request Body

{
  "blockIds": [
    "11111111-1111-1111-1111-111111111111",
    "33333333-3333-3333-3333-333333333333",
    "22222222-2222-2222-2222-222222222222"
  ]
}

Request Velden

Veld Type Vereist Beschrijving
blockIds array Ja Blok-ID's in gewenste uitvoeringsvolgorde

Response (200 OK)

Geeft de bijgewerkte blokvolgorde terug.


Blokuitvoeringsstroom

Blokken vormen een keten waarin elk blok data ontvangt van zijn ouder:

[Onderzoeksstart]
       |
       v
[Filter: Activiteitenfilter] -> Filtert op specifieke activiteiten
       |
       v
[Calculator: Duur] -> Berekent duur voor gefilterde data
       |
       v
[Insight: Statistieken] -> Genereert statistieken over berekende data

Wanneer je blokken herordent, wordt de ouderketen automatisch bijgewerkt.


Implementatievoorbeelden

Python

import requests
import json

BASE_URL = 'https://your-mindzie-instance.com'
TENANT_ID = '12345678-1234-1234-1234-123456789012'
PROJECT_ID = '87654321-4321-4321-4321-210987654321'

class BlockManager:
    def __init__(self, api_key):
        self.headers = {
            'Authorization': f'Bearer {api_key}',
            'Content-Type': 'application/json'
        }

    def list_blocks(self, notebook_id):
        """Lijst alle blokken in een notebook."""
        url = f'{BASE_URL}/api/{TENANT_ID}/{PROJECT_ID}/notebook/{notebook_id}/blocks'
        response = requests.get(url, headers=self.headers)
        response.raise_for_status()
        return response.json()

    def create_block(self, notebook_id, block_type, operator_name, name,
                     description=None, configuration=None, insert_after=None):
        """Maak een nieuw blok aan."""
        url = f'{BASE_URL}/api/{TENANT_ID}/{PROJECT_ID}/notebook/{notebook_id}/blocks'
        data = {
            'blockType': block_type,
            'operatorName': operator_name,
            'name': name,
            'description': description,
            'configuration': json.dumps(configuration) if configuration else None,
            'insertAfterBlockId': insert_after
        }
        response = requests.post(url, json=data, headers=self.headers)
        response.raise_for_status()
        return response.json()

    def get_block_order(self, notebook_id):
        """Haal huidige uitvoeringsvolgorde van blokken op."""
        url = f'{BASE_URL}/api/{TENANT_ID}/{PROJECT_ID}/notebook/{notebook_id}/blocks/order'
        response = requests.get(url, headers=self.headers)
        response.raise_for_status()
        return response.json()

    def reorder_blocks(self, notebook_id, block_ids):
        """Herorden blokken in het notebook."""
        url = f'{BASE_URL}/api/{TENANT_ID}/{PROJECT_ID}/notebook/{notebook_id}/blocks/order'
        response = requests.put(url, json={'blockIds': block_ids}, headers=self.headers)
        response.raise_for_status()
        return response.json()

# Gebruik
manager = BlockManager('your-api-key')
notebook_id = 'aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee'

# Lijst blokken
blocks = manager.list_blocks(notebook_id)
print(f"Vond {blocks['totalCount']} blokken")

# Maak een filterblok aan
filter_block = manager.create_block(
    notebook_id,
    block_type='Filter',
    operator_name='ActivityFilter',
    name='Select Key Activities',
    configuration={'activities': ['Create Order', 'Approve', 'Ship']}
)
print(f"Gemaakt filter: {filter_block['blockId']}")

# Maak een calculatorblok aan na de filter
calc_block = manager.create_block(
    notebook_id,
    block_type='Calculator',
    operator_name='DurationCalculator',
    name='Case Duration',
    configuration={'unit': 'days'},
    insert_after=filter_block['blockId']
)
print(f"Gemaakte calculator: {calc_block['blockId']}")

# Controleer uitvoeringsvolgorde
order = manager.get_block_order(notebook_id)
print(f"Blokvolgorde: {[b['blockId'] for b in order['blockOrder']]}")

JavaScript/Node.js

const BASE_URL = 'https://your-mindzie-instance.com';
const TENANT_ID = '12345678-1234-1234-1234-123456789012';
const PROJECT_ID = '87654321-4321-4321-4321-210987654321';

class BlockManager {
  constructor(apiKey) {
    this.headers = {
      'Authorization': `Bearer ${apiKey}`,
      'Content-Type': 'application/json'
    };
  }

  async listBlocks(notebookId) {
    const url = `${BASE_URL}/api/${TENANT_ID}/${PROJECT_ID}/notebook/${notebookId}/blocks`;
    const response = await fetch(url, { headers: this.headers });
    if (!response.ok) throw new Error(`Mislukt: ${response.status}`);
    return response.json();
  }

  async createBlock(notebookId, blockType, operatorName, name, options = {}) {
    const url = `${BASE_URL}/api/${TENANT_ID}/${PROJECT_ID}/notebook/${notebookId}/blocks`;
    const body = {
      blockType,
      operatorName,
      name,
      description: options.description,
      configuration: options.configuration ? JSON.stringify(options.configuration) : null,
      insertAfterBlockId: options.insertAfter
    };
    const response = await fetch(url, {
      method: 'POST',
      headers: this.headers,
      body: JSON.stringify(body)
    });
    if (!response.ok) throw new Error(`Mislukt: ${response.status}`);
    return response.json();
  }

  async reorderBlocks(notebookId, blockIds) {
    const url = `${BASE_URL}/api/${TENANT_ID}/${PROJECT_ID}/notebook/${notebookId}/blocks/order`;
    const response = await fetch(url, {
      method: 'PUT',
      headers: this.headers,
      body: JSON.stringify({ blockIds })
    });
    if (!response.ok) throw new Error(`Mislukt: ${response.status}`);
    return response.json();
  }
}

// Gebruik
const manager = new BlockManager('your-api-key');
const notebookId = 'aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee';

// Lijst blokken
const blocks = await manager.listBlocks(notebookId);
console.log(`Gevonden ${blocks.totalCount} blokken`);

// Maak blokken aan
const filter = await manager.createBlock(notebookId, 'Filter', 'ActivityFilter', 'Key Activities', {
  configuration: { activities: ['Create', 'Approve'] }
});

const calc = await manager.createBlock(notebookId, 'Calculator', 'DurationCalculator', 'Duration', {
  insertAfter: filter.blockId
});

Best Practices

  1. Blokvolgorde Is Belangrijk: Data stroomt van ouder naar kind - plan je workflow goed
  2. Gebruik Templates: Voor complexe workflows, maak gebruik van sjablonen
  3. Configuratie JSON: Bewaar operator-specifieke instellingen als JSON-strings
  4. InsertAfter: Gebruik insertAfterBlockId om positionering te bepalen
  5. Uitvoering: Voer het notebook uit nadat je blokken hebt gemaakt om resultaten te zien