Hooks and Utilities
Hooks
|
|
|
|
| hides the side navigation while the page is open - use on forms |
|
| sets the browser tab title |
|
|
|
|
| the case inside |
|
|
|
|
|
|
const { user } = useAuth();
const { showNotification } = useNotification();
useHideSideNav();
usePageTitle(`Requisition ${process.businessKey}`);
showNotification("success", "Saved.");
Reading values: getJsonValue
import { getJsonValue } from "@/ecc/core/eccJsonResolve";
const title = getJsonValue<string>(task, "inputs.purchase.title");
const amount = getJsonValue<number>(process, "variables.purchase.netTotal") ?? 0;
const items = getJsonValue<unknown[]>(task, "inputs.purchase.items") ?? [];
Backend calls: ApiService
Import the functions from @/ecc/services/ApiService. They add the login token, handle a session end and return the typed response.
| the user incl. groups |
| one case or |
| cases of a process |
| drafts of the user |
| history entries prepared for display ( |
| all tasks of a case |
| tasks of the user |
| one task or |
| task actions |
| counters for dashboards |
| process definitions and data structures |
const [process, setProcess] = useState<EccProcess | null>(null);
useEffect(() => { getProcessInstanceById("PR260930-3f9a1c2b").then(setProcess); }, []);
Objects in this example: EccProcess.
Do not call fetch yourself. If you need an endpoint that has no function yet, ask for it to be added to ApiService.
Types
|
|
|
|
|
|
Put your own business types (e.g. PurchaseInput) into src/apps/{processId}/types/.
On this page
- Hooks and Utilities