@5minds/processcube_app_sdk 8.5.0 → 8.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -7
- package/build/client/{actions-MB5VDCO7.mjs → actions-AYWPNATG.mjs} +1 -1
- package/build/client/components/DynamicUi/DynamicUi.d.ts +1 -0
- package/build/client/index.cjs +11 -11
- package/build/client/index.mjs +10 -10
- package/build/server/index.cjs +1 -1
- package/build/server/index.mjs +1 -1
- package/package.json +2 -1
- package/build/client/index.css +0 -1
package/README.md
CHANGED
|
@@ -111,12 +111,13 @@ export default nextConfig;
|
|
|
111
111
|
|
|
112
112
|
### CSS einbinden
|
|
113
113
|
|
|
114
|
-
Client-
|
|
114
|
+
Komponenten-CSS wird automatisch geladen — beim Import einer Client-Komponente wird das zugehörige Stylesheet vom Consumer-Bundler (webpack/turbopack) mit aufgelöst. Ein manueller CSS-Import ist in den meisten Fällen nicht nötig.
|
|
115
|
+
|
|
116
|
+
Falls die Tailwind-Basisstyles (Resets, Utilities) separat benötigt werden:
|
|
115
117
|
|
|
116
118
|
```typescript
|
|
117
|
-
//
|
|
118
|
-
import '@5minds/processcube_app_sdk/client/
|
|
119
|
-
import '@5minds/processcube_app_sdk/client/components/BPMNViewer.css';
|
|
119
|
+
// app/layout.tsx
|
|
120
|
+
import '@5minds/processcube_app_sdk/client/styles';
|
|
120
121
|
```
|
|
121
122
|
|
|
122
123
|
### Umgebungsvariablen
|
|
@@ -407,7 +408,7 @@ export default withApplicationSdk({
|
|
|
407
408
|
| `useExternalTasks` | `boolean` | `false` | External Task Worker aktivieren |
|
|
408
409
|
| `customExternalTasksDirPath` | `string` | `./app` oder `./src/app` | Verzeichnis für External Task Handler |
|
|
409
410
|
|
|
410
|
-
Das Plugin fügt automatisch `esbuild` zu `
|
|
411
|
+
Das Plugin fügt automatisch `esbuild` zu `serverExternalPackages` hinzu und startet Worker nur im Server-Modus (nicht während `next build`).
|
|
411
412
|
|
|
412
413
|
### Umgebungsvariablen
|
|
413
414
|
|
|
@@ -549,6 +550,15 @@ const triggered = await getFlowNodeInstancesTriggeredByFlowNodeInstanceIds(['fni
|
|
|
549
550
|
|
|
550
551
|
### User Tasks
|
|
551
552
|
|
|
553
|
+
> **Blocking vs. Non-Blocking:** Einige Funktionen blocken, bis ein Event eintritt. Das ist wichtig für die Wahl der richtigen Funktion:
|
|
554
|
+
>
|
|
555
|
+
> | Funktion | Blockiert? | Use-Case |
|
|
556
|
+
> | ----------------------- | ---------- | -------------------------------------------------- |
|
|
557
|
+
> | `waitForUserTask()` | **Ja** | Server-seitig auf nächsten Task warten (Event-Sub) |
|
|
558
|
+
> | `getWaitingUserTasks()` | Nein | Polling, UI-Abfragen, Server Components |
|
|
559
|
+
> | `getUserTasks()` | Nein | Allgemeine Abfrage mit vollem Query-Objekt |
|
|
560
|
+
> | `waitForProcessEnd()` | **Ja** | Warten bis Prozess beendet (Event-Sub) |
|
|
561
|
+
|
|
552
562
|
#### getWaitingUserTasks
|
|
553
563
|
|
|
554
564
|
Gibt alle wartenden User Tasks zurück.
|
|
@@ -633,7 +643,13 @@ await cancelReservedUserTask(identity, 'flow-node-instance-id');
|
|
|
633
643
|
| `getReservedUserTasksByIdentity(identity?, options?)` | Vom aktuellen User reservierte Tasks |
|
|
634
644
|
| `getAssignedUserTasksByIdentity(identity?, options?)` | Dem aktuellen User zugewiesene Tasks |
|
|
635
645
|
|
|
636
|
-
Alle Funktionen unterstützen einen `identity`-Parameter:
|
|
646
|
+
Alle Funktionen unterstützen einen `identity`-Parameter:
|
|
647
|
+
|
|
648
|
+
| Wert | Verhalten |
|
|
649
|
+
| ----------------- | ------------------------------------------------------------------------------------------------------- |
|
|
650
|
+
| `true` (Default) | Nutzt die implizite User-Identity aus der NextAuth-Session |
|
|
651
|
+
| `false` | Anonymer Zugriff — kein Auth-Header. Voraussetzung: Engine muss `allowAnonymousRootAccess: true` haben. |
|
|
652
|
+
| `Identity`-Objekt | Explizite Identity (z.B. von `getServerIdentity()` oder `getIdentity()`) |
|
|
637
653
|
|
|
638
654
|
### Server Actions
|
|
639
655
|
|
|
@@ -810,11 +826,12 @@ export default function InspectorPage({ processInstanceId }: { processInstanceId
|
|
|
810
826
|
|
|
811
827
|
Rendert dynamische Formulare basierend auf UserTask-FormField-Definitionen. Unterstützt 25+ Feldtypen und Custom Fields.
|
|
812
828
|
|
|
829
|
+
Die Komponente importiert ihr CSS automatisch — ein separater CSS-Import ist nicht nötig.
|
|
830
|
+
|
|
813
831
|
```typescript
|
|
814
832
|
'use client';
|
|
815
833
|
|
|
816
834
|
import { DynamicUi } from '@5minds/processcube_app_sdk/client';
|
|
817
|
-
import '@5minds/processcube_app_sdk/client/components/DynamicUi/DynamicUi.css';
|
|
818
835
|
|
|
819
836
|
export default function TaskForm({ task }) {
|
|
820
837
|
return (
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use server";import"./chunk-YEKQJ4YC.mjs";import{DataModels as C}from"@5minds/processcube_engine_client";import{DataModels as b}from"@5minds/processcube_engine_client";import{getToken as
|
|
1
|
+
"use server";import"./chunk-YEKQJ4YC.mjs";import{DataModels as C}from"@5minds/processcube_engine_client";import{DataModels as b}from"@5minds/processcube_engine_client";import{getToken as d}from"next-auth/jwt";import{ResponseCookies as k}from"next/dist/compiled/@edge-runtime/cookies/index.js";import{cookies as a,headers as y}from"next/headers.js";async function i(){let e=await d({req:{cookies:await a(),headers:await y()}});if(e?.expiresAt&&Date.now()>=e.expiresAt*1e3){let s=await fetch(`${process.env.NEXTAUTH_URL}/api/auth/session`,{method:"GET",headers:{"Content-Type":"application/json",cookie:(await a()).toString()}}),o=new k(s.headers);if(o.getAll().length){let p=!1;try{for(let c of o.getAll())(await a()).set(c.name,c.value,{...c})}catch{p=!0}if(e=await d({req:{cookies:p?o:await a(),headers:await y()}}),e?.error)throw e.error}}if(!e?.accessToken||!e?.sub)throw new Error("AccessToken or Sub could not be determined!");return{token:e?.accessToken,userId:e?.sub}}import{EngineClient as T}from"@5minds/processcube_engine_client";var h=process.env.PROCESSCUBE_ENGINE_URL??"http://localhost:10560",n=new T(h);async function r(){try{return i()}catch{return}}async function u(e){let t=await r();return(await n.processInstances.query({processInstanceId:e},{identity:t,includeXml:!0})).processInstances[0]}async function I(e,t={sortSettings:{sortBy:b.FlowNodeInstances.FlowNodeInstanceSortableColumns.createdAt,sortDir:"ASC"}}){return(await n.flowNodeInstances.query({processInstanceId:e},{...t,identity:t.identity??await r()})).flowNodeInstances}async function l(e){let t=await r();return(await n.flowNodeInstances.query({triggeredByFlowNodeInstance:e},{identity:t})).flowNodeInstances}async function f(e,t,s){let o=await r();await n.processInstances.retryProcessInstance(e,{flowNodeInstanceId:t,newStartToken:s,identity:o})}async function m(e){let t=await r();await n.processInstances.terminateProcessInstance(e,t)}async function w(...e){await n.manualTasks.finishManualTask(...e)}async function g(...e){await n.userTasks.finishUserTask(...e)}async function P(...e){await n.untypedTasks.finishTask(...e)}async function E(){try{return i()}catch{return}}var Q=async(e,t)=>{let s=await E();t==="bpmn:UserTask"?await g(e,{},s):t==="bpmn:ManualTask"?await w(e,s):t==="bpmn:Task"?await P(e,s):console.error(`[@5minds/processcube_app_sdk:handlePlay] Unsupported flow node type: ${t}`)},z=async e=>{await m(e)},J=async(e,t,s)=>{await f(e,t,s)},K=async e=>u(e),V=async e=>I(e,{sortSettings:{sortBy:C.FlowNodeInstances.FlowNodeInstanceSortableColumns.createdAt,sortDir:"DESC"}}),W=async e=>l(e);export{Q as finishTask,V as getFlowNodeInstances,K as getProcessInstance,W as getTriggeredFlowNodeInstances,J as retryProcess,z as terminateProcess};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { PropsWithChildren } from 'react';
|
|
2
2
|
import { DataModels } from '@5minds/processcube_engine_sdk';
|
|
3
3
|
import { UserTaskInstance } from '../../../common/types';
|
|
4
|
+
import './DynamicUi.css';
|
|
4
5
|
import { type DynamicUiFormFieldComponentMap } from './FormFields';
|
|
5
6
|
interface DynamicUiForwardedRefRenderFunction extends React.ForwardRefRenderFunction<DynamicUiRefFunctions, DynamicUiComponentProps> {
|
|
6
7
|
(props: DynamicUiComponentProps, ref: DynamicUiFormFieldRef): React.ReactNode;
|