Skip to content

Commit

Permalink
feat(orchestrator): use assessment process id as bk for next workflows (
Browse files Browse the repository at this point in the history
  • Loading branch information
anludke authored and caponetto committed Jan 16, 2024
1 parent f7acf2f commit ceb13e0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ import validator from '@rjsf/validator-ajv8';
import { JSONSchema7 } from 'json-schema';

import {
getWorkflowCategory,
WORKFLOW_TITLE,
WorkflowCategory,
WorkflowDataInputSchemaResponse,
} from '@janus-idp/backstage-plugin-orchestrator-common';

Expand Down Expand Up @@ -78,13 +76,8 @@ export const ExecuteWorkflowPage = (props: ExecuteWorkflowPageProps) => {
}

setLoading(true);
const workflowCategory = getWorkflowCategory(
schemaResponse?.workflowItem.definition,
);
if (workflowCategory === WorkflowCategory.ASSESSMENT) {
Object.assign(parameters, { businessKey: crypto.randomUUID() });
} else {
Object.assign(parameters, { businessKey: businessKey ?? '' });
if (businessKey !== undefined) {
Object.assign(parameters, { businessKey: businessKey });
}
const response = await orchestratorApi.executeWorkflow({
workflowId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export const AssessmentResultViewer = (props: AssessmentResultViewerProps) => {
<Link
href={executeWorkflowLink({
workflowId: workflowOption.id,
businessKey: selectedInstance?.businessKey ?? '',
businessKey: selectedInstance?.id ?? '',
})}
>
{workflowOption.name}
Expand All @@ -79,7 +79,7 @@ export const AssessmentResultViewer = (props: AssessmentResultViewerProps) => {
<Link
href={executeWorkflowLink({
workflowId: workflowOption.id,
businessKey: selectedInstance?.businessKey ?? '',
businessKey: selectedInstance?.id ?? '',
})}
>
{workflowOption.name}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export const ProcessInstancesTable = (props: ProcessInstancesTableProps) => {
return {
pid: pi.id,
name: pi.processId,
businessKey: pi.businessKey?.substring(0, 8),
businessKey: pi.businessKey?.substring(0, 8) ?? '-',
state: pi.state,
};
})
Expand Down

0 comments on commit ceb13e0

Please sign in to comment.