npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

btpworkflowvalidator

v1.2.3

Published

Validator for SAP BTP Workflow

Downloads

50

Readme

Workflow validator

Workflow validator for SAP BTP Cloud Foundry workflow definitions

Installation

npm i -g btpworkflowvalidator

Usage

Run script start, passing as only argument the folder where the workflow definitions are stored. The structure should look like this:

myproject  
|____**myworkflowproject**  
|____|____ sample-data  
|____|____|____ workflow1  
|____|____|____|____ context.json  
|____|____|____ workflow2  
|____|____|____ workflow3  
|____|____ scripts  
|____|____|____ workflow1  
|____|____|____|____ script1.js  
|____|____|____ workflow2  
|____|____|____ workflow3  
|____|____ webcontent  
|____|____|____ workflow1  
|____|____|____|____ file1.html  
|____|____|____ workflow2  
|____|____|____ workflow3  
|____|____ workflows  
|____|____|____ **workflow1.workflow**  
|____|____|____ **workflow2.workflow**  
|____|____|____ **workflow3.workflow**  

In this example, pass as argument myworkflowproject:

start ./myworkflowproject

The validator will look for workflow definitions (files with extension .workflow) and referenced files inside that folder.

Integration in build cycle

Process exits with error if workflow is not valid.
For example:

    "scripts": {
        "validateWorkflow": "btpworkflowvalidator myworkflowproject",
        "build": "npm run validateWorkflow && mbt build --mtar archive",
        "deploy": "npm run build && cf deploy mta_archives/archive.mtar"
    },

Validations

  • Mandatory fields tasks and important configurations
  • Links between nodes: references to non-existent nodes, orphan nodes, etc
  • Consistency of model definition
  • Duplicate IDs
  • Existence of external files (scripts, html content)
  • Documentation of tasks
  • ES5 syntax for script files, using acorn, as that's what the workflow engine expects, otherwise deployment fails with a misterious error while trying to invoke the method com.sap.bpm.wds.core.model.WorkflowModuleContent.getSubcontents() of a null object loaded from local variable 'obj'

Example output

$ npm run start testworkflows
[Workflow] validworkflow.workflow > Workflow looks alright!
[Workflow] wrongworkflow.workflow > ERROR: Missing mandatory field: id in node: timereventdefinition1 (com.sap.bpm.wfs.TimerEventDefinition)
[Workflow] wrongworkflow.workflow > WARNING: Missing documentation for: Start (com.sap.bpm.wfs.StartEvent)
[Workflow] wrongworkflow.workflow > ERROR: Duplicate ID: endevent1 (com.sap.bpm.wfs.EndEvent)
[Workflow] wrongworkflow.workflow > ERROR: Missing mailDefinitionRef configuration in Mail to approver (com.sap.bpm.wfs.MailTask)
[Workflow] wrongworkflow.workflow > ERROR: Missing mandatory field: mailDefinitionRef in node: Mail to approver (com.sap.bpm.wfs.MailTask)
[Workflow] wrongworkflow.workflow > WARNING: Missing documentation for: Updated? (com.sap.bpm.wfs.ExclusiveGateway)
[Workflow] wrongworkflow.workflow > ERROR: Missing file: /scripts/wrongworkflow/verifyRequesterData.js in Verify requester data (com.sap.bpm.wfs.ScriptTask)
[Workflow] wrongworkflow.workflow > ERROR: Invalid ES5 source file: /scripts/wrongworkflow/scriptNotES5.js. Location: line 3, column 20. Reason: Unexpected token (3:20)
[Workflow] wrongworkflow.workflow > ERROR: Unknown reference to 3b29770b-78ba-4566-b428-bbed131f5afc in SequenceFlow21 (com.sap.bpm.wfs.SequenceFlow)
[Workflow] wrongworkflow.workflow > ERROR: Missing file: /sample-data/workflow/context.json in default-start-context (com.sap.bpm.wfs.SampleContext)
[Workflow] wrongworkflow.workflow > ERROR: Unknown reference to 3b29770b-78ba-4566-b428-bbed131f5afc in undefined (com.sap.bpm.wfs.ui.StartEventSymbol)
[Workflow] wrongworkflow.workflow > ERROR: Orphan node: intermediatetimerevent1 IntermediateTimerEvent1 (com.sap.bpm.wfs.IntermediateCatchEvent)
[Workflow] wrongworkflow.workflow > ERROR: Orphan node: startevent1 Start (com.sap.bpm.wfs.StartEvent)
[Workflow] wrongworkflow.workflow > ERROR: Orphan node: endevent1 Orphan_event_for_testing_with_duplicate_ID (com.sap.bpm.wfs.EndEvent)
[Workflow] wrongworkflow.workflow > ERROR: Orphan node: maildefinition1 maildefinition1 (com.sap.bpm.wfs.MailDefinition)
[Workflow] wrongworkflow.workflow > ERROR: Unknown reference to 3b29770b-78ba-4566-b428-bbed131f5afc in workflow (com.sap.bpm.wfs.Model)
[Workflow] wrongworkflow.workflow > ERROR: Unknown reference to 39e43cc2-0c00-45ed-b7f7-cce9c225fb1c29 in workflow (com.sap.bpm.wfs.Model)
[Workflow] wrongworkflow.workflow > Workflow has 15 errors and 2 warnings