ProcessCube® App-SDK
Das ProcessCube® App-SDK ermöglicht die schnelle Entwicklung von Next.js-basierten Anwendungen mit direkter Integration zur ProcessCube® Engine.
Features
- Next.js 13+ App Router - Moderne React Server Components
- TypeScript Support - Vollständig typisierte API
- Authority Integration - OAuth 2.0 Authentifizierung
- Vorgefertigte Components - Ready-to-use React Components
- Server-Side Functions - Sichere Engine-Kommunikation
- External Task Workers - Automatische Worker-Registrierung
- Type-Safe - IntelliSense und Auto-Completion
Quick Start
# App-SDK installieren
npm install @5minds/processcube_app_sdk@latest// User Tasks abrufen
import { getWaitingUserTasks } from '@5minds/processcube_app_sdk/server';
export default async function Page() {
const tasks = await getWaitingUserTasks();
return (
<ul>
{tasks.userTasks.map((task) => (
<li key={task.flowNodeInstanceId}>{task.flowNodeName}</li>
))}
</ul>
);
}Dokumentation
- Getting Started - Installation, Konfiguration und erste Schritte
- Configuration - Environment Variables und Plugin System
- Components - Vorgefertigte React Components (in Kürze)
- Functions - Server-Side Helper Functions (in Kürze)
- Examples - Vollständige Beispiele und Use Cases (in Kürze)
Was ist möglich?
User Task Management
import {
getWaitingUserTasks,
finishUserTask
} from '@5minds/processcube_app_sdk/server';
// Tasks abrufen
const tasks = await getWaitingUserTasks();
// Task abschließen
await finishUserTask({
flowNodeInstanceId: task.id,
userTaskResult: { approved: true }
});Prozess-Verwaltung
import {
getProcessModels,
startProcessInstance
} from '@5minds/processcube_app_sdk/server';
// Verfügbare Prozesse
const processes = await getProcessModels();
// Prozess starten
const instance = await startProcessInstance({
processModelId: 'OrderProcess',
startEventId: 'StartEvent_1',
initialToken: { orderId: '12345' }
});External Task Workers
app/external-tasks/send-email.ts
import type { ExternalTaskHandlerFunction } from '@5minds/processcube_app_sdk/server';
const handler: ExternalTaskHandlerFunction = async (task) => {
// E-Mail senden
await sendEmail(task.variables);
return { success: true };
};
export default handler;React Components
import { RemoteUserTask } from '@5minds/processcube_app_sdk/client';
<RemoteUserTask
flowNodeInstanceId={task.id}
onFinish={() => console.log('Task completed')}
/>Support & Links
- GitHub: github.com/processcube-io
- npm Package: @5minds/processcube_app_sdk
- Beispiel-Apps: Examples