2.4.4 • Published 2 months ago

process-reporting-ts v2.4.4

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

Process Report Starter

Dependency management is a critical aspects of any complex project. And doing this manually is less than ideal; the more time you spent on it the less time you have on the other important aspects of the project. Process report Starter were built to address exactly this problem. You get a one-stop-shop for all the functionality that you need to audit your process flow.

Event Reporting Workflow

Event Reporting Process View

Event Reporting Instance View

Event Reporting Instance Details View

Event Reporting Porcess Diagram View

Event Reporting Porcess Report View

Requirements

  • NPM package
      npm install process-reporting-ts
  • @BpmnElement on method

      import {BpmnElement} from "process-reporting-ts";
    
      @BpmnElement(id = "Event_1anjljr", startEvent = true, keyExpression = "{{ event.PO_NUMBER }}")
      public execute(PurchaseOrderEvent event) {
    
          return ...;
      }
    
      ----
    
      @BpmnElement(id = "Activity_194xhhj")
      public execute(PurchaseOrder data) {
    
          return ...;
      }
    
      ---
    
      @BpmnElement(id = "Event_0byexdn", endEvent = true)
      public execute(ProcurementOrder procurementOrder, boolean purchaseOrderExists) {
    
          return ...;
      }
  • AOP on function

import {interceptHandler} from "process-reporting-ts";

function execute(PurchaseOrderEvent data) {

   return ...
}

const aopHandler = interceptHandler(execute, {
    startEvent: true,
    instanceIdExpression: '{{ headers.TX_ID }}',
    keyExpression: '{{ data.PO_NUMBER }}'
})
  • .env
    REPORTING_PROCESS_ID: Process_0e2hw2v
    REPORTING_PROCESS_SERVER: http://localhost:9090/reporting-service/rest
    REPORTING_PROCESS_VERSION: 1.0
  • BPMN process-flow.bpmn
    • Event Reporting Workflow

Testing

Unit Test

npm test

API

REST Report API

@POST ${reporting.server}/api/report

@BODY {
    ...@ReportEvent
}

REST Process API

@POST ${reporting.server}/api/process

@BODY {
    ...@ProcessEvent
}

REST Heart Beat API

@POST ${reporting.server}/api/definition/heart-beat

@BODY {
    ...@HeartBeatEvent
}

REST Process Definition API

@POST ${reporting.server}/api/definition

@BODY {
    ...@RegisterEvent
}

Reporting Properties

NameTypeRequiredDefault ValueDescription
processIdStringtrueUnique Process Id
processNameStringtrueProcess Name
processVersionStringtrue1.0Process Version
serverStringtrueProcess Reporting Service
heartBeatCronStringfalse0 /2 ? * *report heart beat for current service
maxEventContentLimitintfalse2000Max event content size

BaseReportEvent

NameTypeRequiredDefault ValueDescription
transactionIdStringtrueUnique Transaction Id generated by system
processIdStringtrueUnique Process Id
processVersionStringtrue1.0Process Version
executionIdStringtrueProcess Unique execution Id generated by system
errorMessageStringfalseError Message during execution
statusReportStatusfalsereport status STARTED, COMPLETED, ...
eventTimeLocalDateTimetruenowEvent time generated by system
retryCountintfalse0Retry Count
partCountintfalse0Part Count im Event maxEventContentLimit exceeded

ProcessEvent extends BaseReportEvent

NameTypeRequiredDefault ValueDescription
eventTriggeredTimeLocalDateTimetrueEvent Triggered time from source system
startByStringtruewho started the process?
boundedContextStringtrueBounded Context that process belong to
eventTypeStringtrueEvent Type CREATED, UPDATED, DELETED, ...
eventSourceStringtrueEvent Source who throw this event? (System-A)
runtimeIdStringtrueRuntime Id generated by system
referenceIdStringtrueReference Id

ReportEvent extends BaseReportEvent

NameTypeRequiredDefault ValueDescription
elementIdStringtrueBPMN Element unique Id
multipleInstanceIndexStringtrueTask may be executed multiple times
payloadStringtrueEvent Payload like Json or primitive Objects

HeartBeatEvent

NameTypeRequiredDefault ValueDescription
processIdStringtrueUnique Process Id
processVersionStringtrue1.0Process Version
eventTimeLocalDateTimetrue0Event time generated by system

RegisterEvent

NameTypeRequiredDefault ValueDescription
processDiagramStringtrueProcess XML Diagram
processIdStringtrueUnique Process Id
processVersionStringtrue1.0Process Version
boundedContextStringtrueBounded Context that process belong to
fileNameStringtrueProcess XML Diagram file name

ReportStatus

TypeDescription
QUEUEDProcess has been queued
STARTEDProcess/Task has been started
RESTARTEDProcess/Task has been restarted
COMPLETEDProcess/Task has been completed
WARNINGTask has ended with warning but Process keep running
ERRORTask has ended with error and Process has been terminated

Technology Stack

  • Nodejs v16.20.2
  • Third Party Libraries
    • jest 29.5.8
    • model-converter (MIT License)
    • mustache 4.2.5
    • typescript 5.2.2
    • axios-observable 2.0.0
  • Code-Analyses
    • Sonar
    • jest coverage

License

MIT (unless noted otherwise)

2.3.0

2 months ago

2.2.0

2 months ago

2.4.1

2 months ago

2.3.2

2 months ago

2.4.0

2 months ago

2.3.1

2 months ago

2.4.3

2 months ago

2.4.2

2 months ago

2.4.4

2 months ago

2.0.7

2 months ago

2.0.6

2 months ago

2.0.9

2 months ago

2.0.8

2 months ago

2.1.0

2 months ago

2.0.3

5 months ago

2.0.5

5 months ago

2.0.4

5 months ago

2.0.2

5 months ago

2.0.1

5 months ago

2.0.0

5 months ago

1.0.3

5 months ago

1.0.2

5 months ago

1.0.1

5 months ago

1.0.0

5 months ago