bpm-core
v0.0.146
Published
- Update your project to **Angular 19** to avoid compatibility issues. - Review the [Changes Log](#changes-log) for breaking changes and apply necessary updates.
Readme
⚠️ Read Before Upgrading
- Update your project to Angular 19 to avoid compatibility issues.
- Review the Changes Log for breaking changes and apply necessary updates.
Table of Contents
Recently Added Features
BPM Core CLI
A command-line interface tool that provides helper scripts to speed up common tasks.
Run the tool using the
bpm-corecommand in your terminal.
To see all available commands, run:npx bpm-core --helpThe BPM Core CLI includes several helper scripts. You can run any script using its corresponding command.
Below is the available commands:
deploy— Supports only library services.Use this command to deploy your service to one of the following environments:
dev,sit, orbat.The deployment process includes:
- Running the Angular build
- Syncing with the remote repository
- Triggering a Jenkins job
Example usage
In your terminal, navigate to the service directory and run the following command:npx bpm-core deploy --env sit --repo-path D:\stc\build\sit --commit-msg "COW: correct typo in Arabic translation" --remote-dir "cow-new" --username jenkinsUserName --token jenkinsTokenOrPasswordFor more details about available options, run:
npx bpm-core deploy --helpgenerate(alias:g) — Supports only library services.Provides the following subcommands:
mock(alias:m).Use this subcommand to generate mock data for your service. The generated mock data will be saved in your service root as a file named
mock-output.json.Example usage
In your terminal, navigate to the service directory and run the following command:
npx bpm-core generate mock # or using aliases npx bpm-core g mnew(alias:n)Use this subcommand to generate a new service, just like the form builder does.
Example usage
First, create the service directory. Then, in your terminal, navigate to that directory and run the following command:
npx bpm-core generate new --config config.json --service-code MSM # or using aliases npx bpm-core g n --config config.json --service-code MSMThe required options are:
--configthe generation config path (like a form builder config).--service-codethe service code.
Uploading file as formdata ** "version": "0.0.144"**
Examples:
Example 1: upload file using file-uploader component
<app-file-uploader [maxSize]="'20'" [sendAsFormdata]="true" [multiple]="true" > </app-file-uploader>- Example 2: upload file using attachment-section component
<app-attachment-section [sendAsFormdata]="true"> </app-attachment-section> </app-file-uploader>
Input Mapping and Filtering
The
app-inputcomponent now supports two powerful inputs:[mapFn]— A function that modifies the input value before it's rendered, allowing for transformations like uppercase conversion, formatting, or character replacement.[filterFn]— A function that validates or restricts what characters can be typed, pasted, or dropped into the input.
Built-in Utility Classes Provided:
InputFilters:InputFilters.arabicOnlyInputFilters.englishOnlyInputFilters.digitsOnlyInputFilters.buildPattern()
InputMappers:InputMappers.toUpperCaseInputMappers.toLowerCase
Examples:
Example 1: Custom filter – Allow only numbers
numbersOnlyFilter: InputFilterFn = (char, current, next, event) => { return /^[0-9]+$/.test(char); };<app-input label="Phone Number" [filterFn]="numbersOnlyFilter" ></app-input>Example 2: Built-in filter – Arabic-only characters
import { InputFilters } from 'bpm-core'; class MyComponent { InputFilters = InputFilters; }<app-input label="الاسم بالعربية" [filterFn]="InputFilters.arabicOnly" ></app-input>💡 Hint: Use
InputFilters.buildPattern()when you need to customize exactly which characters are allowed in an input.
You can combine multiple character groups like Arabic letters, digits, symbols, and spaces then generate a custom filter function using.build().Example 3: Custom filter using
buildPattern()— Allow English letters, digits, spaces, and symbolsimport { InputFilters } from 'bpm-core'; class MyComponent { customEnglishFilter = InputFilters.buildPattern() .allowEnglishAlphabets() .allowDigits() .allowSpace() .allowSymbols() .build(); }<app-input label="Username" [filterFn]="customEnglishFilter" ></app-input>Example 4: Custom map — Capitalize first letter of each word
capitalizeWordsMapFn: InputMapFn = (char, current, next) => { return next.replace(/\b\w/g, (match) => match.toUpperCase()); };<app-input label="Full Name" [mapFn]="capitalizeWordsMapFn" ></app-input>Example 5: Built-in map — Force lowercase
import { InputMappers } from 'bpm-core'; class MyComponent { InputMappers = InputMappers; }<app-input label="Email" [mapFn]="InputMappers.toLowercase" ></app-input>
Time Picker
To use it, import
TimepickerComponentin your TypeScript file and add<app-timepicker>to your template. For more information, hover over the selector after adding it to your template.Summary Section
This is a stage that appears before the request stage.
To enable this feature:
The summary section must be the first item in the
workflowStepslist.The
detailsobject for this step must include the following property:"stage0": { "isStage0": "true" }
Example of a full payload:
{ "data": { "requester": { ... }, "workflowSteps": [ { "actor": { "recipient": { "role": "stage0" } }, "details": { "litigantType": "", "other": "", "requestType": "", "reqSubject": "", "claimValue": "", "subClassification": "", "reqDetails": "", "plainName": "", "stage0": { "isStage0": "true" } } }, { "actor": { ... }, "date": "", "details": { ... } } ], "request": { ... }, "form": { ... } }, "meta": { ... } }
Changes Log
[email protected] — 2025-10-06
- fix(npm): resolve npm install issues.
[email protected] — 2025-09-18
- feat(cli): add
generate newcommand to generate an initial service from a config like the form builder. - fix(cli/mock-data): restructure LOVs in payload and enhance logged path generation.
- [BREAKING CHANGE] fix(custom-searchable): update the default value of the
keyinput property to 'value' (was 'description'). - feat(radio): activate and enhance radio component.
- refactor: remove ngx-translate package.
- [BREAKING CHANGE] refactor(input & textarea): remove 'enOnly' and 'arOnly' type values, use filterFn instead.
- fix(input-number): prevent dropping text into input number.
- [BREAKING CHANGE] refactor(attachment-section): replace
isRequiredinput withdescriptionRequiredinput and addcommentsRequiredinput. - fix(attachment-section): hide label in read-only mode if no attachments.
- fix(custom-searchable): add padding for search and clear icons in RTL.
- feat(input): add
maxLengthinput property. - feat(datepicker): support typed inputs for
minDate,maxDate,customMinDate, andcustomMaxDate. - feat(search-employee): add
selectedEmployeeoutput to emit the full details of the selected employee.
[email protected] — 2025-09-01
- feat(cli): add generate command with mock subcommand to produce mock data
- fix(file-uploader): update max length error visibility when removing an attachment from multiple files.
[email protected] — 2025-08-25
- feat(cli): implement BPM Core CLI with deploy command.
- refactor(app-input): remove keyType parameter from filter function.
[email protected] — 2025-08-06
- feat(app-input):
app-inputnow supportsfilterFnandmapFninputs. - feat(validation-errors): Added default error messages for
maxandminvalidators.
[email protected] — 2025-07-30
- fix(file-uploader): avoid clearing attachments with multiple enabled.
- fix(file-uploader): activate "maxLength" input to specify maximum number of files
- fix(attachment-section): resolve _intl console error and translate MatPaginator labels to Arabic.
[email protected] — 2025-07-23
- fix: resolve issue with downloading attachments from comments history.
[email protected] — 2025-07-17
- Added default placeholders for all inputs.
- Ensured placeholders passed to inputs display correctly.
