Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
d511098
Added two ways to deploy processes from the modeler
jjoderis Feb 10, 2026
54c8336
Fixed: the executable checkbox in the properties panel always shows t…
jjoderis Feb 10, 2026
5b52a36
Removed unused imports
jjoderis Feb 10, 2026
7242465
Added version and deploy functionality to the process list and added …
jjoderis Feb 10, 2026
859726e
Added functionality to start instances from the process list
jjoderis Feb 11, 2026
1b001de
Disable instance start button in process list when automation is not …
jjoderis Feb 11, 2026
70006d7
Moved the engine selection into the version selection for starting a …
jjoderis Feb 12, 2026
a2bce50
Merge branch 'main' of github.com:PROCEED-Labs/proceed into ms/proces…
jjoderis Feb 24, 2026
01a75f6
Merge branch 'main' of github.com:PROCEED-Labs/proceed into ms/proces…
jjoderis Mar 9, 2026
0eba466
Removed some debug logging
jjoderis Mar 9, 2026
dc154de
Merge branch 'main' of github.com:PROCEED-Labs/proceed into ms/proces…
jjoderis Mar 10, 2026
92075e8
Merge branch 'main' of github.com:PROCEED-Labs/proceed into ms/proces…
jjoderis Mar 16, 2026
589d361
Moved some files from app folder to components folder to show that th…
jjoderis Mar 16, 2026
250e38f
Renamed a function from getExtendedEngines to getUniqueEngines to bet…
jjoderis Mar 16, 2026
810b564
Improved the code for shortcut deployment and instance starting
jjoderis Mar 17, 2026
c384e82
Ran prettier
jjoderis Mar 17, 2026
7507f7a
Removed redundant code
jjoderis Mar 17, 2026
66d30fe
Undid some unnecessary changes
jjoderis Mar 17, 2026
62c677b
Removed another change
jjoderis Mar 17, 2026
9ad605c
Small improvements
jjoderis Mar 17, 2026
7e813d1
Undid some more unnecessary changes
jjoderis Mar 17, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,8 @@ import { getLatestDeployment, getVersionInstances, getYoungestInstance } from '.
import useColors from './use-colors';
import useTokens from './use-tokens';
import { DeployedProcessInfo } from '@/lib/engines/deployment';
import StartFormModal from './start-form-modal';
import StartFormModal from '@/components/start-form-modal';
import useInstanceVariables from './use-instance-variables';
import { inlineScript, inlineUserTaskData } from '@proceed/user-task-helper';

export default function ProcessDeploymentView({
processId,
Expand Down Expand Up @@ -117,7 +116,7 @@ export default function ProcessDeploymentView({
};
}, [deploymentInfo, selectedVersionId, selectedInstanceId]);

const { variableDefinitions, variables } = useInstanceVariables({
const { variableDefinitions } = useInstanceVariables({
process: deploymentInfo,
version: currentVersion,
});
Expand Down Expand Up @@ -194,14 +193,6 @@ export default function ProcessDeploymentView({
if (typeof startForm !== 'string') return startForm;

if (startForm) {
const mappedVariables = Object.fromEntries(
variables
.filter((variable) => variable.value !== undefined)
.map((variable) => [variable.name, variable.value]),
);
startForm = inlineScript(startForm, '', '', variableDefinitions);
startForm = inlineUserTaskData(startForm, mappedVariables, []);

setStartForm(startForm);
} else {
return startInstance(versionId);
Expand Down Expand Up @@ -364,19 +355,13 @@ export default function ProcessDeploymentView({

<StartFormModal
html={startForm}
variableDefinitions={variableDefinitions}
onSubmit={async (submitVariables) => {
const versionId = getLatestDeployment(deploymentInfo).versionId;

const mappedVariables: Record<string, { value: any }> = {};

// set the values of variables to the ones coming from the start form
Object.entries(submitVariables).forEach(
([key, value]) => (mappedVariables[key] = { value }),
);

// start the instance with the initial variable values from the start form
await wrapServerCall({
fn: () => startInstance(versionId, mappedVariables),
fn: () => startInstance(versionId, submitVariables),

onSuccess: async (instanceId) => {
await refetch();
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ import DeploymentsList from './deployments-list';
import { Folder } from '@/lib/data/folder-schema';
import { Process, ProcessMetadata } from '@/lib/data/process-schema';
import { useEnvironment } from '@/components/auth-can';
import { processHasChangesSinceLastVersion } from '@/lib/data/processes';
import { processUnchangedFromBasedOnVersion } from '@/lib/data/processes';
import type { DeployedProcessInfo } from '@/lib/engines/deployment';
import { useRouter } from 'next/navigation';
import { deployProcess as serverDeployProcess } from '@/lib/engines/server-actions';
import { wrapServerCall } from '@/lib/wrap-server-call';
import { SpaceEngine } from '@/lib/engines/machines';
import { userError } from '@/lib/user-error';
import { isUserErrorResponse, userError } from '@/lib/user-error';
import { removeDeployment as serverRemoveDeployment } from '@/lib/engines/server-actions';
import { useQueryClient } from '@tanstack/react-query';

Expand Down Expand Up @@ -58,22 +58,29 @@ const DeploymentsView = ({
startCheckingProcessVersion(async () => {
wrapServerCall({
fn: async () => {
const processChangedSinceLastVersion = await processHasChangesSinceLastVersion(
const unchangedVersion = await processUnchangedFromBasedOnVersion(
process.id,
space.spaceId,
);
if (typeof processChangedSinceLastVersion === 'object')
return processChangedSinceLastVersion;
if (isUserErrorResponse(unchangedVersion)) {
return unchangedVersion;
}

let latestVersion = process.versions[0];
for (const version of process.versions)
if (+version.createdOn > +latestVersion.createdOn) latestVersion = version;
let versionToUse = unchangedVersion;

if (!latestVersion) throw userError('Process has no versions').error;
if (!versionToUse) {
let latestVersion = process.versions[0];
for (const version of process.versions)
if (+version.createdOn > +latestVersion.createdOn) latestVersion = version;

versionToUse = latestVersion.id;
}

if (!versionToUse) throw userError('Process has no versions').error;

const res = await serverDeployProcess(
process.id,
latestVersion.id,
versionToUse,
space.spaceId,
'dynamic',
forceEngine,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { ComponentProps, use, useEffect, useState } from 'react';
import { is as bpmnIs } from 'bpmn-js/lib/util/ModelUtil';
import { App, Tooltip, Button, Space, Select, SelectProps, Divider } from 'antd';
import { Tooltip, Button, Space, Divider, Select, SelectProps } from 'antd';
import { Toolbar, ToolbarGroup } from '@/components/toolbar';
import styles from './modeler-toolbar.module.scss';
import Icon, {
InfoCircleOutlined,
PlusOutlined,
UndoOutlined,
RedoOutlined,
ArrowUpOutlined,
Expand All @@ -17,15 +16,13 @@ import { PiDownloadSimple } from 'react-icons/pi';
import { SvgGantt, SvgXML } from '@/components/svg';
import PropertiesPanel from './properties-panel';
import useModelerStateStore from './use-modeler-state-store';
import { useRouter, useSearchParams, usePathname } from 'next/navigation';
import VersionCreationButton from '@/components/version-creation-button';
import { useRouter, useSearchParams } from 'next/navigation';
import useMobileModeler from '@/lib/useMobileModeler';
import { createVersion, updateProcess, getProcessBPMN } from '@/lib/data/processes';
import { updateProcess } from '@/lib/data/processes';
import { Root } from 'bpmn-js/lib/model/Types';
import { useEnvironment } from '@/components/auth-can';
import { ShareModal } from '@/components/share-modal/share-modal';
import { useAddControlCallback } from '@/lib/controls-store';
import { spaceURL } from '@/lib/utils';
import { isUserErrorResponse } from '@/lib/user-error';
import useTimelineViewStore from '@/lib/use-timeline-view-store';
import { handleOpenDocumentation } from '../../processes-helper';
Expand All @@ -42,7 +39,8 @@ import { Element } from 'bpmn-js/lib/model/Types';
import { ScriptTaskEditorEnvironment } from './script-task-editor/script-task-editor-environment';
import { Folder } from '@/lib/data/folder-schema';

const LATEST_VERSION = { id: '-1', name: 'Latest Version', description: '' };
import VersionAndDeploy, { LATEST_VERSION } from './version-and-deploy-section';
import { spaceURL } from '@/lib/utils';

type ModelerToolbarProps = {
process: Process;
Expand All @@ -60,13 +58,11 @@ const ModelerToolbar = ({
}: ModelerToolbarProps) => {
const processId = process.id;

const router = useRouter();
const pathname = usePathname();
const environment = useEnvironment();
const app = App.useApp();
const message = app.message;
const env = use(EnvVarsContext);

const router = useRouter();

const [showUserTaskEditor, setShowUserTaskEditor] = useState(false);

const [showPropertiesPanel, setShowPropertiesPanel] = useState(false);
Expand Down Expand Up @@ -170,41 +166,6 @@ const ModelerToolbar = ({

const selectedVersionId = query.get('version');

const createProcessVersion = async (values: {
versionName: string;
versionDescription: string;
}) => {
try {
// Ensure latest BPMN on server.
const xml = (await modeler?.getXML()) as string;
if (isUserErrorResponse(await updateProcess(processId, environment.spaceId, xml)))
throw new Error();

if (
isUserErrorResponse(
await createVersion(
values.versionName,
values.versionDescription,
processId,
environment.spaceId,
),
)
)
throw new Error();

// reimport the new version since the backend has added versionBasedOn information that would
// be overwritten by following changes
const newBpmn = await getProcessBPMN(processId, environment.spaceId);
if (newBpmn && typeof newBpmn === 'string') {
await modeler?.loadBPMN(newBpmn);
}

router.refresh();
message.success('Version Created');
} catch (_) {
message.error('Something went wrong');
}
};
const handlePropertiesPanelToggle = () => {
setShowPropertiesPanel(!showPropertiesPanel);
};
Expand Down Expand Up @@ -316,15 +277,9 @@ const ModelerToolbar = ({
label: name,
}))}
/>
<VersionAndDeploy process={process} />
{!showMobileView && LATEST_VERSION.id === selectedVersion.id && (
<>
<Tooltip title="Release a new Version of the Process">
<VersionCreationButton
icon={<PlusOutlined />}
createVersion={createProcessVersion}
disabled={isListView}
></VersionCreationButton>
</Tooltip>
<Tooltip title="Undo">
<Button icon={<UndoOutlined />} onClick={handleUndo} disabled={!canUndo}></Button>
</Tooltip>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,6 @@ const Modeler = ({ versionName, process, folder, inEditing, ...divProps }: Model
const setFullScreen = useModelerStateStore((state) => state.setFullScreen);
const setIsExecutable = useModelerStateStore((state) => state.setIsExecutable);

useEffect(() => {
setIsExecutable(process.executable || false);
}, [process]);

const { isListView, processContextPath } = useProcessView();

/// Derived State
Expand Down Expand Up @@ -167,7 +163,6 @@ const Modeler = ({ versionName, process, folder, inEditing, ...divProps }: Model
}, [process.id]);

useEffect(() => {
console.log('modeler changed');
setModeler(modeler.current);

setCanUndo(false);
Expand Down Expand Up @@ -210,7 +205,6 @@ const Modeler = ({ versionName, process, folder, inEditing, ...divProps }: Model

const onRootChange = useCallback<Required<BPMNCanvasProps>['onRootChange']>(
async (root) => {
console.log('root changed');
setRootElement(root);
// When the current root (the visible layer [the main
// process/collaboration or some collapsed subprocess]) is changed to a
Expand Down Expand Up @@ -275,7 +269,6 @@ const Modeler = ({ versionName, process, folder, inEditing, ...divProps }: Model
// (unless the subprocess does not exist anymore because the process
// changed)
setLoaded(true);
console.log('onLoaded');
if (subprocessId && modeler.current) {
const canvas = modeler.current.getCanvas();
const subprocessPlane = canvas
Expand All @@ -289,6 +282,13 @@ const Modeler = ({ versionName, process, folder, inEditing, ...divProps }: Model
);
}
}

// set the executable value for the currently open version
const root = modeler.current?.getCurrentRoot();
if (root && bpmnIs(root, 'bpmn:Process')) {
const executable = root.businessObject.isExecutable;
setIsExecutable(executable || false);
}
}, [messageApi, subprocessId]);

const onShapeRemove = useCallback<Required<BPMNCanvasProps>['onShapeRemove']>((element) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
'use client';

import {
useCallback,
useEffect,
useImperativeHandle,
useMemo,
useRef,
useState,
forwardRef,
} from 'react';
import { useEffect, useImperativeHandle, useMemo, useRef, useState, forwardRef } from 'react';
import dynamic from 'next/dynamic';
import {
Button,
Expand Down Expand Up @@ -275,10 +267,15 @@ const ScriptEditor = forwardRef<ScriptEditorRef, ScriptEditorProps>(
<IoExtensionPuzzleOutline style={{ transform: 'translateY(2px)' }} size={15} />
}
onClick={() => setSelectedEditor('blockly')}
disabled={!canEdit}
>
No-Code Block Editor
</Button>
<Button icon={<FormOutlined size={15} />} onClick={() => setSelectedEditor('JS')}>
<Button
icon={<FormOutlined size={15} />}
onClick={() => setSelectedEditor('JS')}
disabled={!canEdit}
>
JavaScript Editor
</Button>
</Space>
Expand Down
Loading
Loading