Skip to content

Commit

Permalink
commit for version 2.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
vamsee committed Apr 30, 2020
2 parents 229c8c6 + 2013cf5 commit 5279e96
Show file tree
Hide file tree
Showing 78 changed files with 4,119 additions and 728 deletions.
10 changes: 7 additions & 3 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/client/
/coverage/
/node_modules/
build/
client/
coverage/
node_modules/
test/
drop.js
Gruntfile.js
2 changes: 1 addition & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
"no-undefined": 1, // http://eslint.org/docs/rules/no-undefined
"no-with": 2, // http://eslint.org/docs/rules/no-with
"handle-callback-err": 1, // http://eslint.org/docs/rules/handle-callback-err
"radix": 2, // http://eslint.org/docs/rules/radix
"radix": 0, // http://eslint.org/docs/rules/radix
"wrap-iife": [2, "any"], // http://eslint.org/docs/rules/wrap-iife
"yoda": 2, // http://eslint.org/docs/rules/yoda

Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,5 @@ dev
.vimrc
test/bpmn-files-todo
test/todo
*.js1
*.js1
oracle-user.sh
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ${REGISTRY}/alpine-node:8.11.4
FROM ${REGISTRY}/alpine-node:12-alpine

RUN mkdir -p /home/src

Expand All @@ -12,4 +12,4 @@ WORKDIR /home/src

COPY . /home/src

CMD node bin/index.js
CMD node bin/app.js
37 changes: 2 additions & 35 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,44 +10,13 @@ module.exports = function GruntConfig(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),

mkdir: {
all: {
options: {
create: ['dist']
}
}
},

copy: {
main: {
files: [
// includes files within path and its sub-directories
{
expand: true,
src: ['**', '!node_modules/**', '!coverage/**'],
dest: 'dist/'
}
]
}
},
lint: {
target: [
'common/**/*.js',
'server/**/*.js',
'test/**/*.js'
]
},
mochaTest: {
test: {
options: {
quiet: false,
bail: false,
clearRequireCache: true,
timeout: 100000
},
src: ['test/bootstrap.js', 'test/scripts/*.js']
}
},

clean: {
coverage: {
Expand Down Expand Up @@ -79,12 +48,10 @@ module.exports = function GruntConfig(grunt) {
});

// Add the grunt-mocha-test tasks.
grunt.loadNpmTasks('grunt-mocha-test');
grunt.loadNpmTasks('grunt-mocha-istanbul');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-mocha-istanbul');

grunt.loadNpmTasks('grunt-eslint');
grunt.loadNpmTasks('grunt-mkdir');
grunt.loadNpmTasks('grunt-contrib-copy');

grunt.registerTask('all', ['lint', 'clean:coverage', 'mocha_istanbul']);
grunt.registerTask('test-with-coverage', ['clean:coverage', 'mocha_istanbul']);
Expand Down
18 changes: 0 additions & 18 deletions ISSUES.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,6 @@
`trying to make invalid state change` error message **4 times**. It looks like,
end-token is being added 5 times and only 1 would succeed (?).

* User-Task Complete
Code appears to be selecting process-instance and process-definition in
Task.complete(Task.complete_) functions. This (atleast the process-definition)
need not be selected again in ProcessInstance.completeTask.

* Designer Issue
In an exclusive-gateway, the default path need not have any condition-expression.
But when such bpmn file is loaded, the property panel shows error for script-format field `must provide a value`

* Convergence of Inclusive Gateway
Looks like not supported. All branches execute independently and follow the entire remaining path.
______A____
[s]-----[ig]______B____[ig]--[e]

Above diagram takes s -> IG -> (A-IG-E) as well as (B-IG-E)
rather than S->IG-(A & B)->IG->E
i.e. converging Inclusive-Gateway (and subsequent nodes) are executed for each path.

# WorkflowSignal.broadcast
Selects all `WorkflowSignal` instance by name and selects (`findById`) all corresponding `ProcessInstance`. If the instance is running it sends an `INTERMEDIATE_CATCH_EVENT` event to it.
The (potential) issue is, `WorkflowSignal` records are never removed. So the broadcast function selecting signals by name will select all old signals and for each old signal it will select the process-instance and ignore it as this may have completed. There by making the engine slowly sluggish.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ _oe-workflow_ can be interacted and managed through either function level API's
## Getting Started
* Clone the git repository for refapp ```git clone https://github.com/EdgeVerve/oe-workflow.git```
* Install Node modules ``` npm install ```
* Start the Application ```node . ```
* Start the Application ```npm run app```

## Coding Guidelines
Please refer to [Coding Guidlines](./Coding_Guidelines.md) document.
Expand Down
4 changes: 4 additions & 0 deletions bin/component-config.json
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
{
"oe-workflow-modeler/component": {
"mountPath": "/wfmodeler",
"extensionsPath": "../../bin/pallet-entries.json"
}
}
3 changes: 2 additions & 1 deletion bin/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
"workflow":{
"addonModule": "utils/addon-functions",
"recovery": {
"retryInterval": 2000
"retryInterval": 600000,
"stalePeriod": 30000
}
},
"masterJobExecutor": {
Expand Down
12 changes: 5 additions & 7 deletions bin/datasources.docker.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
*
*/
var mongoHost = process.env.MONGO_HOST || 'localhost';
var mongoPort = process.env.MONGO_PORT ? parseInt(process.env.MONGO_PORT) : 27017;
var dbName = process.env.DB_NAME || 'oe-workflow-test';
module.exports =
{
module.exports = {
'memdb': {
'name': 'memdb',
'connector': 'memory'
Expand All @@ -18,13 +18,11 @@ module.exports =
},
'db': {
'host': mongoHost,
'port': 27017,
'url': 'mongodb://' + mongoHost + ':27017/' + dbName,
'port': mongoPort,
'url': 'mongodb://' + mongoHost + ':' + mongoPort + '/' + dbName,
'database': dbName,
'password': 'admin',
'name': 'db',
'connector': 'mongodb',
'user': 'admin',
'connector': 'oe-connector-mongodb',
'connectionTimeout': 500000
}
};
Expand Down
2 changes: 1 addition & 1 deletion bin/datasources.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"database": "oe-workflow",
"password": "admin",
"name": "db",
"connector": "mongodb",
"connector": "oe-connector-mongodb",
"user": "admin",
"connectionTimeout": 50000
}
Expand Down
12 changes: 5 additions & 7 deletions bin/datasources.mongo.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
*
*/
var mongoHost = process.env.MONGO_HOST || 'localhost';
var mongoPort = process.env.MONGO_PORT ? parseInt(process.env.MONGO_PORT) : 27017;
var dbName = process.env.DB_NAME || 'oe-workflow-test';
module.exports =
{
module.exports = {
'memdb': {
'name': 'memdb',
'connector': 'memory'
Expand All @@ -18,13 +18,11 @@ module.exports =
},
'db': {
'host': mongoHost,
'port': 27017,
'url': 'mongodb://' + mongoHost + ':27017/' + dbName,
'port': mongoPort,
'url': 'mongodb://' + mongoHost + ':' + mongoPort + '/' + dbName,
'database': dbName,
'password': 'admin',
'name': 'db',
'connector': 'mongodb',
'user': 'admin',
'connector': 'oe-connector-mongodb',
'connectionTimeout': 500000
}
};
Expand Down
10 changes: 2 additions & 8 deletions bin/datasources.oracle.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,10 @@
* Bangalore, India. All Rights Reserved.
*
*/
/**
**
** ©2016-2017 EdgeVerve Systems Limited (a fully owned Infosys subsidiary),
** Bangalore, India. All Rights Reserved.
**
**/

var oracleSID = process.env.ORACLE_SID || 'orclpdb.ad.infosys.com';
var oracleSID = process.env.ORACLE_SID || 'ORCLCDB';
var oracleHost = process.env.ORACLE_HOST || 'localhost';
var oraclePort = process.env.ORACLE_PORT || 1521;
var oraclePort = process.env.ORACLE_PORT ? parseInt(process.env.ORACLE_PORT) : 1521;
var oracleUserName = process.env.ORACLE_USERNAME || 'oeadmin';
var oracleUserPassword = process.env.ORACLE_PASSWORD || 'oeadmin';

Expand Down
9 changes: 4 additions & 5 deletions bin/datasources.postgres.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
*
*/
var postgresHost = process.env.POSTGRES_HOST || 'localhost';
var postgresPort = process.env.POSTGRES_PORT ? parseInt(process.env.POSTGRES_PORT) : 5432;
var dbName = process.env.DB_NAME || 'oe-workflow-test';
module.exports =
{
module.exports = {
'memdb': {
'name': 'memdb',
'connector': 'memory'
Expand All @@ -16,11 +16,10 @@ module.exports =
'name': 'transient',
'connector': 'transient'
},

'db': {
'host': postgresHost,
'port': 5432,
'url': 'postgres://postgres:postgres@' + postgresHost + ':5432/' + dbName,
'port': postgresPort,
'url': 'postgres://postgres:postgres@' + postgresHost + ':' + postgresPort + '/' + dbName,
'database': dbName,
'password': 'postgres',
'name': 'db',
Expand Down
6 changes: 4 additions & 2 deletions common/mixins/maker-checker-mixin-v1.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ var logger = require('oe-logger');
var log = logger('maker-checker-mixin');

module.exports = function MakerCheckerMixin(Model) {
// Skip this mixin where ever not applicable.
// Skip this mixin whereever not applicable.
if (skipThisMixinIfNotApplicable(Model)) {
return;
}
Expand Down Expand Up @@ -46,7 +46,9 @@ module.exports = function MakerCheckerMixin(Model) {
Model.updateId = uuidv4();

// to enable newly added REST Endpoints on fly
Model.app.model(Model);
if (Model.app) {
Model.app.model(Model);
}
};

// function addBeforeRemotes(Model) {
Expand Down
6 changes: 4 additions & 2 deletions common/mixins/maker-checker-mixin-v2.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ var logger = require('oe-logger');
var log = logger('maker-checker-mixin-v2');

module.exports = function MakerCheckerMixin(Model) {
// Skip this mixin where ever not applicable.
// Skip this mixin whereever not applicable.
if (skipThisMixinIfNotApplicable(Model)) {
return;
}
Expand All @@ -31,7 +31,9 @@ module.exports = function MakerCheckerMixin(Model) {
Model.settings._workflowEnabled = true;
}
// to enable newly added REST Endpoints on fly
Model.app.model(Model);
if (Model.app) {
Model.app.model(Model);
}
};

function skipThisMixinIfNotApplicable(Model) {
Expand Down
19 changes: 17 additions & 2 deletions common/mixins/workflow-mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,26 @@ const log = logger('workflow-mixin');
const uuidv4 = require('uuid/v4');

module.exports = function WorkflowMixin(Model) {
// Skip this mixin whereever not applicable.
if (skipThisMixinIfNotApplicable(Model)) {
return;
}

if (!Model.settings._workflowMixinEnabled) {
addOERemoteMethods(Model);
addRemoteHooks(Model);
Model.settings._workflowMixinEnabled = true;
}
};

function skipThisMixinIfNotApplicable(Model) {
if (Model.definition.name === 'BaseEntity') {
log.debug(log.defaultContext(), 'skipping mixin for - ', Model.definition.name);
return true;
}
return false;
}

function addOERemoteMethods(Model) {
Model.remoteMethod('workflow', {
description: 'Find workflow instance attached to the model instance by id.',
Expand Down Expand Up @@ -149,8 +162,10 @@ function addOERemoteMethods(Model) {
};
};

// to refresh swagger json
Model.app.emit('modelRemoted', Model.sharedClass);
if (Model.app) {
// to refresh swagger json
Model.app.emit('modelRemoted', Model.sharedClass);
}
}

function addRemoteHooks(Model) {
Expand Down
48 changes: 48 additions & 0 deletions common/models/durableTimeout.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@

{
"name": "DurableTimeout",
"base": "WorkflowBaseEntity",
"description" : "Manages timer event execution in oe-workflow engine",
"idInjection": true,
"properties": {
"definition": {
"type": "string",
"required": true
},
"nextExecution": {
"type": "date",
"index": true,
"required": true
},
"schedule": {
"type": ["date"]
},
"counter": {
"type": "number",
"default": 0
},
"perpetual": {
"type": "boolean",
"default": false
},
"status": {
"type": "string",
"index": true,
"required": true,
"default": "pending"
},
"tokenId": {
"type" : "string",
"required" : true
}
},
"validations": [],
"relations": {
"processInstance": {
"type": "belongsTo",
"model": "ProcessInstance",
"foreignKey": "processInstanceId"
}
},
"acls": []
}
Loading

0 comments on commit 5279e96

Please sign in to comment.