Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion lib/build/validation-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
} from '../shared/input-parser';

export type ElementType = {
type: string;
type?: string;
isMandatory?: boolean;
isArray?: boolean;
properties?: Record<string, ElementType>;
Expand Down
10 changes: 1 addition & 9 deletions lib/processImport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,6 @@ function addProcessTypes(
const attributesName = fqn(serviceName, 'ProcessAttributes');
const instanceName = fqn(serviceName, 'ProcessInstance');
const instancesName = fqn(serviceName, 'ProcessInstances');
const statusName = fqn(serviceName, 'ProcessInstanceStatus');

definitions[inputsName] = buildTypeFromSchema(
inputsName,
Expand Down Expand Up @@ -241,12 +240,6 @@ function addProcessTypes(
name: instancesName,
items: { type: instanceName },
};

definitions[statusName] = {
kind: 'type',
name: statusName,
items: { type: csn.CdsBuiltinType.String },
};
}

// ============================================================================
Expand All @@ -263,7 +256,6 @@ function addProcessActions(
const outputsType = fqn(serviceName, 'ProcessOutputs');
const attributesType = fqn(serviceName, 'ProcessAttributes');
const instancesType = fqn(serviceName, 'ProcessInstances');
const statusType = fqn(serviceName, 'ProcessInstanceStatus');

// Start action — three tiers:
// 1. No input properties: start() with no params
Expand Down Expand Up @@ -311,7 +303,7 @@ function addProcessActions(
name: fqn(serviceName, 'getInstancesByBusinessKey'),
params: {
businessKey: { type: csn.CdsBuiltinType.String, notNull: true },
status: { type: statusType },
status: { items: { type: csn.CdsBuiltinType.String } },
},
returns: { type: instancesType },
};
Expand Down
2 changes: 1 addition & 1 deletion lib/types/csn-extensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ export interface CsnAnnotation extends CsnBaseDefinition {
// ──────────────────────────────────────────────────────────────
//
export interface CsnElement extends CsnAnnotations {
type: CdsTypeRef;
type?: CdsTypeRef;
notNull?: boolean;
key?: boolean;
virtual?: boolean;
Expand Down
4 changes: 0 additions & 4 deletions tests/bookshop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,6 @@
}
}
},
"eu12.bpm-horizon-walkme.sdshipmentprocessor.ShipmentHandlerService": {
"kind": "process-service",
"model": "srv/external/eu12.bpm-horizon-walkme.sdshipmentprocessor.shipmentHandler"
},
"eu12.cdsmunich.capprocesspluginhybridtest.Annotation_Lifecycle_ProcessService": {
"kind": "process-service",
"model": "srv/external/eu12.cdsmunich.capprocesspluginhybridtest.annotation_Lifecycle_Process"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* checksum : 2365826f2b0b2661a4f9ebd32c09fc28 */
/* checksum : 2d9b04f7d100bb10cefeaa255ec0b188 */
namespace eu12.cdsmunich.capprocesspluginhybridtest;

/** DO NOT EDIT. THIS IS A GENERATED SERVICE THAT WILL BE OVERRIDDEN ON NEXT IMPORT. */
Expand Down Expand Up @@ -31,8 +31,6 @@ service Annotation_Lifecycle_ProcessService {

type ProcessInstances : many ProcessInstance;

type ProcessInstanceStatus : many String;

action start(
inputs : ProcessInputs not null
);
Expand All @@ -47,7 +45,7 @@ service Annotation_Lifecycle_ProcessService {

function getInstancesByBusinessKey(
businessKey : String not null,
status : ProcessInstanceStatus
status : many String
) returns ProcessInstances;

action suspend(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* checksum : 06cf8c9d9e2f98deda3afc8c9105860c */
/* checksum : b2be28c9da2617d511526b2f68e5e6b0 */
namespace eu12.cdsmunich.capprocesspluginhybridtest;

/** DO NOT EDIT. THIS IS A GENERATED SERVICE THAT WILL BE OVERRIDDEN ON NEXT IMPORT. */
Expand Down Expand Up @@ -67,8 +67,6 @@ service ImportProcess_Attributes_And_OutputsService {

type ProcessInstances : many ProcessInstance;

type ProcessInstanceStatus : many String;

action start(
inputs : ProcessInputs not null
);
Expand All @@ -83,7 +81,7 @@ service ImportProcess_Attributes_And_OutputsService {

function getInstancesByBusinessKey(
businessKey : String not null,
status : ProcessInstanceStatus
status : many String
) returns ProcessInstances;

action suspend(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* checksum : c03cdf2e606ab17a35b5c033564432b3 */
/* checksum : b0ced28bb4d1bef714f6714bff14642e */
namespace eu12.cdsmunich.capprocesspluginhybridtest;

/** DO NOT EDIT. THIS IS A GENERATED SERVICE THAT WILL BE OVERRIDDEN ON NEXT IMPORT. */
Expand Down Expand Up @@ -59,8 +59,6 @@ service ImportProcess_Complex_InputsService {

type ProcessInstances : many ProcessInstance;

type ProcessInstanceStatus : many String;

action start(
inputs : ProcessInputs not null
);
Expand All @@ -75,7 +73,7 @@ service ImportProcess_Complex_InputsService {

function getInstancesByBusinessKey(
businessKey : String not null,
status : ProcessInstanceStatus
status : many String
) returns ProcessInstances;

action suspend(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* checksum : 0f35e7076c73088aa94343c24de08931 */
/* checksum : 7e054e53e107a7f5c8375eb51a454e7f */
namespace eu12.cdsmunich.capprocesspluginhybridtest;

/** DO NOT EDIT. THIS IS A GENERATED SERVICE THAT WILL BE OVERRIDDEN ON NEXT IMPORT. */
Expand Down Expand Up @@ -36,8 +36,6 @@ service ImportProcess_Simple_InputsService {

type ProcessInstances : many ProcessInstance;

type ProcessInstanceStatus : many String;

action start(
inputs : ProcessInputs not null
);
Expand All @@ -52,7 +50,7 @@ service ImportProcess_Simple_InputsService {

function getInstancesByBusinessKey(
businessKey : String not null,
status : ProcessInstanceStatus
status : many String
) returns ProcessInstances;

action suspend(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* checksum : 0a304afe8e7feed2939e6a02b72700f2 */
/* checksum : 721729e92c5456fb13b5e792ac205215 */
namespace eu12.cdsmunich.capprocesspluginhybridtest;

/** DO NOT EDIT. THIS IS A GENERATED SERVICE THAT WILL BE OVERRIDDEN ON NEXT IMPORT. */
Expand Down Expand Up @@ -33,8 +33,6 @@ service Programmatic_Lifecycle_ProcessService {

type ProcessInstances : many ProcessInstance;

type ProcessInstanceStatus : many String;

action start(
inputs : ProcessInputs not null
);
Expand All @@ -49,7 +47,7 @@ service Programmatic_Lifecycle_ProcessService {

function getInstancesByBusinessKey(
businessKey : String not null,
status : ProcessInstanceStatus
status : many String
) returns ProcessInstances;

action suspend(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* checksum : 485333e131f4ed3e5a2f2b623a290f1e */
/* checksum : 5d4deaa24aac52f7afcf274a034ff450 */
namespace eu12.cdsmunich.capprocesspluginhybridtest;

/** DO NOT EDIT. THIS IS A GENERATED SERVICE THAT WILL BE OVERRIDDEN ON NEXT IMPORT. */
Expand Down Expand Up @@ -40,8 +40,6 @@ service Programmatic_Output_ProcessService {

type ProcessInstances : many ProcessInstance;

type ProcessInstanceStatus : many String;

action start(
inputs : ProcessInputs not null
);
Expand All @@ -56,7 +54,7 @@ service Programmatic_Output_ProcessService {

function getInstancesByBusinessKey(
businessKey : String not null,
status : ProcessInstanceStatus
status : many String
) returns ProcessInstances;

action suspend(
Expand Down
3 changes: 1 addition & 2 deletions tests/bookshop/srv/programmatic-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,12 @@ class ProgrammaticService extends cds.ApplicationService {
});

this.on('getAttributes', async (req: cds.Request) => {
const { ID, status } = req.data;
const { ID } = req.data;
const programmaticLifecycleProcess = await cds.connect.to(
Programmatic_Lifecycle_ProcessService,
);
const processInstances = await programmaticLifecycleProcess.getInstancesByBusinessKey({
businessKey: ID,
status: status,
});
const allAttributes = [];
for (const instance of processInstances) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* checksum : 06cf8c9d9e2f98deda3afc8c9105860c */
/* checksum : b2be28c9da2617d511526b2f68e5e6b0 */
namespace eu12.cdsmunich.capprocesspluginhybridtest;

/** DO NOT EDIT. THIS IS A GENERATED SERVICE THAT WILL BE OVERRIDDEN ON NEXT IMPORT. */
Expand Down Expand Up @@ -67,8 +67,6 @@ service ImportProcess_Attributes_And_OutputsService {

type ProcessInstances : many ProcessInstance;

type ProcessInstanceStatus : many String;

action start(
inputs : ProcessInputs not null
);
Expand All @@ -83,7 +81,7 @@ service ImportProcess_Attributes_And_OutputsService {

function getInstancesByBusinessKey(
businessKey : String not null,
status : ProcessInstanceStatus
status : many String
) returns ProcessInstances;

action suspend(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* checksum : c03cdf2e606ab17a35b5c033564432b3 */
/* checksum : b0ced28bb4d1bef714f6714bff14642e */
namespace eu12.cdsmunich.capprocesspluginhybridtest;

/** DO NOT EDIT. THIS IS A GENERATED SERVICE THAT WILL BE OVERRIDDEN ON NEXT IMPORT. */
Expand Down Expand Up @@ -59,8 +59,6 @@ service ImportProcess_Complex_InputsService {

type ProcessInstances : many ProcessInstance;

type ProcessInstanceStatus : many String;

action start(
inputs : ProcessInputs not null
);
Expand All @@ -75,7 +73,7 @@ service ImportProcess_Complex_InputsService {

function getInstancesByBusinessKey(
businessKey : String not null,
status : ProcessInstanceStatus
status : many String
) returns ProcessInstances;

action suspend(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* checksum : 0f35e7076c73088aa94343c24de08931 */
/* checksum : 7e054e53e107a7f5c8375eb51a454e7f */
namespace eu12.cdsmunich.capprocesspluginhybridtest;

/** DO NOT EDIT. THIS IS A GENERATED SERVICE THAT WILL BE OVERRIDDEN ON NEXT IMPORT. */
Expand Down Expand Up @@ -36,8 +36,6 @@ service ImportProcess_Simple_InputsService {

type ProcessInstances : many ProcessInstance;

type ProcessInstanceStatus : many String;

action start(
inputs : ProcessInputs not null
);
Expand All @@ -52,7 +50,7 @@ service ImportProcess_Simple_InputsService {

function getInstancesByBusinessKey(
businessKey : String not null,
status : ProcessInstanceStatus
status : many String
) returns ProcessInstances;

action suspend(
Expand Down
Loading