office-dynamixs-ai/doc/A2A.md

103 lines
2.9 KiB
Markdown

# A2A
Die Skill-ID wird damit zur direkten "Adresse" für die Workflow-Ausführung.
Skill-ID als Execution Path:
```
Skill ID: "office-de-1.0.0_100_10"
│ │ │
│ │ └── eventId (10 = "Freigeben")
│ └────── taskId (100 = "Freigabe")
└───────────────────── modelVersion ("office-de-1.0.0")
```
## Direct Execution via A2A message/send:
```java
// Aus A2A Skill ID direkt Imixs Execution Parameter extrahieren
String skillId = "office-de-1.0.0_100_10";
String[] parts = skillId.split("_");
String modelVersion = parts[0];
int taskId = Integer.parseInt(parts[1]);
int eventId = Integer.parseInt(parts[2]);
// Direkt Imixs ProcessWorkitem aufrufen
workflowService.processWorkitem(workitem, modelVersion, taskId, eventId);
```
## A2A Message → Imixs Workflow Mapping:
```json
{
"method": "message/send",
"params": {
"message": {
"parts": [
{
"kind": "data",
"data": {
"skillId": "office-de-1.0.0_100_10",
"workitemId": "12345-67890-abcdef",
"parameters": {
"comment": "Approved - Budget OK",
"amount": 1500.0
}
}
}
]
}
}
}
```
Example Skill Task
```json
{
"a2a_skill": {
"id": "invoice-workflow-2.1_100_10",
"name": "Invoice Approval",
"description": "Approve invoices after financial review and compliance check. This action moves the invoice to the payment processing stage and triggers automatic payment scheduling.",
"tags": [
"invoice",
"approval",
"finance",
"payment",
"compliance",
"workflow",
"business-critical"
],
"examples": [
"Approve invoice INV-2024-001 with comment 'Budget confirmed, proceed with payment'",
"Approve recurring invoice from vendor Acme Corp for monthly services",
"Approve invoice with manual adjustment: reduce amount to 1450.00 EUR due to discount"
],
"inputModes": ["application/json", "text/plain"],
"outputModes": ["application/json", "text/html", "text/plain"],
"metadata": {
"imixs": {
"workflowGroup": "Invoice",
"taskName": "Rechnungsprüfung",
"eventName": "Freigeben",
"requiredRoles": ["manager", "finance", "accounting"],
"estimatedDuration": "PT15M",
"priority": "high",
"nextTask": 200,
"nextTaskName": "Zahlungsfreigabe",
"formFields": ["comment", "adjustedAmount", "paymentDate"],
"notificationEnabled": true,
"requiresApprovalLimit": 5000.0
},
"a2a": {
"complexity": "medium",
"isLongRunning": false,
"requiresHumanInteraction": true,
"canCreateNewWorkitem": false,
"requiresWorkitem": true,
"category": "business_process",
"businessImpact": "high"
}
}
}
}
```