Giter VIP home page Giter VIP logo

camunda-bpm-sdk-js's Introduction

Deprecated

This repository moved here: https://github.com/camunda/camunda-bpm-platform/tree/master/webapps/camunda-bpm-sdk-js

camunda-bpm-sdk-js

Javascript client library for Camunda Platform

Install using bower

bower install camunda-bpm-sdk-js --save

Documentation

See https://docs.camunda.org/manual/7.5/reference/embedded-forms/

Development

npm install
grunt auto-build

Testing

Karma

grunt karma

Alternatively, you can use the specific targets

grunt karma:dev-form
# or
grunt karma:dev-form-angularjs

Mocha CLI

grunt mochacli
# or
grunt watch:mochacli

Issues

https://app.camunda.com/jira/browse/CAM/component/12351

Releasing

Release

To create a release:

grunt publish:release --setversion='myReleaseVersion'

This will update the version, commit and tag it, then publish it to bower-camunda-bpm-sdk-js

Snapshot

To create a snapshot release which just builds current head and publishes it to bower-camunda-bpm-sdk-js on a branch named by the current version:

grunt publish:snapshot

Version

If you just want to update the current version:

grunt publish:version --setversion='myNewVersion'

Available options

  • --no-bower -> skip bower release
  • --no-write -> dryRun mode

Examples

Contributing

You are more than welcome to take part in the development of this project!

Coding

Clone the repository, add, fix or improve and send us a pull request. But please take care about the commit messages, our conventions can be found here.

Coding style guide

In place of a guide, just follow the formatting of existing code :-)

License

The source files in this repository are made available under the Apache License Version 2.0.

camunda-bpm-sdk-js's People

Contributors

bentrm avatar berndruecker avatar davidepastore avatar dependabot-support avatar dependabot[bot] avatar hawky-4s- avatar lightswitch05 avatar lukashavemann avatar marstamm avatar mboskamp avatar menski avatar meyerdan avatar mschoe avatar netzwerch avatar plungu avatar rmoskal avatar romansmirnov avatar saig0 avatar samnalkande avatar sebastianstamm avatar siffogh avatar solognt avatar stsc-pentasys avatar tasso94 avatar thorbenlindhauer avatar yanavasileva avatar zeropaper avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

camunda-bpm-sdk-js's Issues

Store only updated variables

When I call the store function, all variables are stored but I need only updated variables.

In the current situation, if some variable is changed in some parallel form the current stored variable, even if it is not changed (and in most of my cases the values is only for visualization), is stored with the older value. And in submit function it takes preference over the current value from server.

In my point of view, only changed variables should be stored when I call the store function. The others should always be fetched from server.

Dependabot couldn't find a package.json for this project

Dependabot couldn't find a package.json for this project.

Dependabot requires a package.json to evaluate your project's current JavaScript dependencies. It had expected to find one at the path: /vendor/fast-xml-parser/package.json.

If this isn't a JavaScript project, or if it is a library, you may wish to disable updates for it from within Dependabot.

View the update logs.

json variables send to restapi can't deserialize

I want send a json type variables,but it got error
var variables = {data:{name:'smith',sex:0,age:18,hobby:['sing','read']}} processDefinitionService.submitForm({ id: processDefinitionId, businessKey: '1234', variables: { formdata: { value: JSON.stringify(variables).replace(/"/g,'\\"'), type: 'json' } } }
it's success start a process,but i can't get the variables,it got error
/engine-rest/task/02ac0cef-9c74-11e9-bd72-0255ac1001b9/variables
response
{
"type": "ProcessEngineException",
"message": "Cannot deserialize object in variable 'formdata': SPIN/JACKSON-JSON-01001 Unable to parse input into json node"
}
what should i do?

Multiple snyk vulnerabilities in this project.

Hi Team,

I use this as node module in my application and while trying to cleanup the vulnerabilities I found various vulnerabilities are due to this module in my dependency.

`✗ High severity vulnerability found on [email protected]

`✗ High severity vulnerability found on [email protected]

`✗ High severity vulnerability found on [email protected]

`✗ High severity vulnerability found on [email protected]

`✗ Medium severity vulnerability found on [email protected]

I guess most of these dependency of this project, which are causing vulnerabilities, are for the development purpose and so can we move them to devDependency to make sure they don't affect the production?

Feature request: publish Typescript type definitions

It would ease use of this library in Typescript projects if there were type definitions published. It's clear that the types of many objects, arguments, etc. have been thought about (given the JSDoc comments); would be great to see those those type definitions formalized (e.g., as a .d.ts) so that they can be consumed directly in Typescript.

Dependabot can't resolve your JavaScript dependency files

Dependabot can't resolve your JavaScript dependency files.

As a result, Dependabot couldn't update your dependencies.

The error Dependabot encountered was:

Error whilst updating rollup in /vendor/superagent/package-lock.json:
404 Not Found - GET https://app.camunda.com/nexus/content/groups/npm-public/@types%2festree

If you think the above is an error on Dependabot's side please don't hesitate to get in touch - we'll do whatever we can to fix it.

You can mention @dependabot in the comments below to contact the Dependabot team.

Dependabot couldn't find a package.json for this project

Dependabot couldn't find a package.json for this project.

Dependabot requires a package.json to evaluate your project's current JavaScript dependencies. It had expected to find one at the path: /vendor/fast-xml-parser/package.json.

If this isn't a JavaScript project, or if it is a library, you may wish to disable updates for it from within Dependabot.

You can mention @dependabot in the comments below to contact the Dependabot team.

Vulnerabilities - Upgrade Angular to Version 1.3.0 or higher.

We ran Snyk Wizard on our project and found following vulnerabilities. Could you please address them?


✗ Low severity vulnerability found on [email protected]

✗ Medium severity vulnerability found on [email protected]

✗ Medium severity vulnerability found on [email protected]

✗ High severity vulnerability found on [email protected]

✗ High severity vulnerability found on [email protected]

✗ High severity vulnerability found on [email protected]

✗ Medium severity vulnerability found on [email protected]

✗ Medium severity vulnerability found on [email protected]

✗ Medium severity vulnerability found on [email protected]


REST endpoint response vs camunda-bpm-sdk-js method response defers

Hi,

This is not a issue more of a enquiry. I am using Camunda SDK to fetch list of tasks when I try the direct rest endpoint I get an array of tasks but if I use SDK I get the response something like below.

{
_link: ...
_embedded: {
assignee:[],
processDefinition:[],
tasks:[]
}
count:4
}
Also processDefinition is embedded inside each task which I don't need. Is there any configuration I can change to get the exact same response as it comes from REST endpoint?

Example of superagent-mock-config.js

I didn't find any documentation for the tests provided, would be helpful how to call the get/post function available in exports of this file. The test under test/client/coreSpec.js just initializes and unsets it.

CORSE blocks XHR for the protocol scheme http

I noticed the following error in the JS console while debugging a embedded task form:
camunda-bpm-sdk-angular.js:7471 XMLHttpRequest cannot load app:forms/validate-order.html?noCache=1465802773984. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.f.end @ camunda-bpm-sdk-angular.js:7471 XHR finished loading: GET "http://localhost:8090/camunda/api/engine/engine/default/task/1ddc76ff-30aa-11e6-b43f-c03896721ccf".

Of course HTTPS would solve this issue. But during development I try to avoid TLS as long as I don't have a need for it (YAGNI principle). The question is: Does this error lead to any problems, side effects or inconsistent state? If yes it should be strongly recommended to setup SSL/TLS also for development.

Using SDK for full process execution

Is it possible to use API for full process automation, beyond form implementation?

I.e.

  • Auth
  • Create instance
  • Claim tasks
  • Complete tasks

If it is possible, please provide documentation.
I am trying to create SPA with custom interface and using Camunda BPM only via REST API.

fsevents error on npm install node 8.12.0

fsevent dependecy pointing to a specific commit (github:pipobscure/fsevents#7dcdf9fa3f8956610fd6f69f72c67bace2de7138) which creates a lot of errors under node v8.12 on npm install (using git://github.com/camunda/camunda-bpm-sdk-js #7.9.6 , but changing the version does not help)

> fsevents@github:pipobscure/fsevents#7dcdf9fa3f8956610fd6f69f72c67bace2de7138 install /Users/****/node_modules/camunda-bpm-sdk-js/node_modules/fsevents
> node-gyp rebuild

  CXX(target) Release/obj.target/fse/fsevents.o
In file included from ../fsevents.cc:6:
../../nan/nan.h:339:13: error: no member named 'New' in 'v8::String'
    return  _NAN_ERROR(v8::Exception::Error, errmsg);
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../nan/nan.h:319:50: note: expanded from macro '_NAN_ERROR'
# define _NAN_ERROR(fun, errmsg) fun(v8::String::New(errmsg))
                                     ~~~~~~~~~~~~^
../../nan/nan.h:343:5: error: no member named 'ThrowException' in namespace 'v8'
    _NAN_THROW_ERROR(v8::Exception::Error, errmsg);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../nan/nan.h:324:11: note: expanded from macro '_NAN_THROW_ERROR'
      v8::ThrowException(_NAN_ERROR(fun, errmsg));                             \
      ~~~~^
../../nan/nan.h:343:5: error: no member named 'New' in 'v8::String'
    _NAN_THROW_ERROR(v8::Exception::Error, errmsg);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../nan/nan.h:324:26: note: expanded from macro '_NAN_THROW_ERROR'
      v8::ThrowException(_NAN_ERROR(fun, errmsg));                             \
                         ^~~~~~~~~~~~~~~~~~~~~~~
../../nan/nan.h:319:50: note: expanded from macro '_NAN_ERROR'
# define _NAN_ERROR(fun, errmsg) fun(v8::String::New(errmsg))
                                     ~~~~~~~~~~~~^
../../nan/nan.h:348:9: error: no type named 'ThrowException' in namespace 'v8'
    v8::ThrowException(error);
    ~~~~^
../../nan/nan.h:355:65: error: no member named 'New' in 'v8::String'
    v8::Local<v8::Value> err = v8::Exception::Error(v8::String::New(msg));
                                                    ~~~~~~~~~~~~^
../../nan/nan.h:356:50: error: expected '(' for function-style cast or type construction
    v8::Local<v8::Object> obj = err.As<v8::Object>();
                                       ~~~~~~~~~~^
../../nan/nan.h:356:52: error: expected expression
    v8::Local<v8::Object> obj = err.As<v8::Object>();
                                                   ^
../../nan/nan.h:357:65: error: too few arguments to function call, expected 2, have 1
    obj->Set(v8::String::New("code"), v8::Int32::New(errorNumber));
                                      ~~~~~~~~~~~~~~            ^
/Users/****/.node-gyp/8.12.0/include/node/v8.h:2979:3: note: 'New' declared here
  static Local<Integer> New(Isolate* isolate, int32_t value);
  ^
In file included from ../fsevents.cc:6:
../../nan/nan.h:357:26: error: no member named 'New' in 'v8::String'
    obj->Set(v8::String::New("code"), v8::Int32::New(errorNumber));
             ~~~~~~~~~~~~^
../../nan/nan.h:369:12: error: no member named 'New' in 'v8::String'
    return _NAN_ERROR(v8::Exception::TypeError, errmsg);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../nan/nan.h:319:50: note: expanded from macro '_NAN_ERROR'
# define _NAN_ERROR(fun, errmsg) fun(v8::String::New(errmsg))
                                     ~~~~~~~~~~~~^
../../nan/nan.h:373:5: error: no member named 'ThrowException' in namespace 'v8'
    _NAN_THROW_ERROR(v8::Exception::TypeError, errmsg);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../nan/nan.h:324:11: note: expanded from macro '_NAN_THROW_ERROR'
      v8::ThrowException(_NAN_ERROR(fun, errmsg));                             \
      ~~~~^
../../nan/nan.h:373:5: error: no member named 'New' in 'v8::String'
    _NAN_THROW_ERROR(v8::Exception::TypeError, errmsg);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../nan/nan.h:324:26: note: expanded from macro '_NAN_THROW_ERROR'
      v8::ThrowException(_NAN_ERROR(fun, errmsg));                             \
                         ^~~~~~~~~~~~~~~~~~~~~~~
../../nan/nan.h:319:50: note: expanded from macro '_NAN_ERROR'
# define _NAN_ERROR(fun, errmsg) fun(v8::String::New(errmsg))
                                     ~~~~~~~~~~~~^
../../nan/nan.h:377:12: error: no member named 'New' in 'v8::String'
    return _NAN_ERROR(v8::Exception::RangeError, errmsg);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../nan/nan.h:319:50: note: expanded from macro '_NAN_ERROR'
# define _NAN_ERROR(fun, errmsg) fun(v8::String::New(errmsg))
                                     ~~~~~~~~~~~~^
../../nan/nan.h:381:5: error: no member named 'ThrowException' in namespace 'v8'
    _NAN_THROW_ERROR(v8::Exception::RangeError, errmsg);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../nan/nan.h:324:11: note: expanded from macro '_NAN_THROW_ERROR'
      v8::ThrowException(_NAN_ERROR(fun, errmsg));                             \
      ~~~~^
../../nan/nan.h:381:5: error: no member named 'New' in 'v8::String'
    _NAN_THROW_ERROR(v8::Exception::RangeError, errmsg);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../nan/nan.h:324:26: note: expanded from macro '_NAN_THROW_ERROR'
      v8::ThrowException(_NAN_ERROR(fun, errmsg));                             \
                         ^~~~~~~~~~~~~~~~~~~~~~~
../../nan/nan.h:319:50: note: expanded from macro '_NAN_ERROR'
# define _NAN_ERROR(fun, errmsg) fun(v8::String::New(errmsg))
                                     ~~~~~~~~~~~~^
../../nan/nan.h:406:13: error: no member named 'smalloc' in namespace 'node'
    , node::smalloc::FreeCallback callback
      ~~~~~~^
../../nan/nan.h:141:71: note: expanded from macro 'NAN_INLINE'
# define NAN_INLINE(declarator) inline __attribute__((always_inline)) declarator
                                                                      ^~~~~~~~~~
../../nan/nan.h:416:12: error: no matching function for call to 'New'
    return node::Buffer::New(data, size);
           ^~~~~~~~~~~~~~~~~
/Users/****/.node-gyp/8.12.0/include/node/node_buffer.h:52:40: note: candidate function not viable: no known conversion from 'char *' to 'v8::Isolate *' for 1st argument
NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate, size_t length);
                                       ^
/Users/****/.node-gyp/8.12.0/include/node/node_buffer.h:55:40: note: candidate function not viable: no known conversion from 'char *' to 'v8::Isolate *' for 1st argument
NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
                                       ^
/Users/****/.node-gyp/8.12.0/include/node/node_buffer.h:67:40: note: candidate function not viable: requires 3 arguments, but 2 were provided
NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
                                       ^
/Users/****/.node-gyp/8.12.0/include/node/node_buffer.h:60:40: note: candidate function not viable: requires 5 arguments, but 2 were provided
NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
                                       ^
In file included from ../fsevents.cc:6:
../../nan/nan.h:420:12: error: no matching function for call to 'New'
    return node::Buffer::New(size);
           ^~~~~~~~~~~~~~~~~
/Users/****/.node-gyp/8.12.0/include/node/node_buffer.h:52:40: note: candidate function not viable: requires 2 arguments, but 1 was provided
NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate, size_t length);
                                       ^
/Users/****/.node-gyp/8.12.0/include/node/node_buffer.h:55:40: note: candidate function not viable: requires at least 2 arguments, but 1 was provided
NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
                                       ^
/Users/****/.node-gyp/8.12.0/include/node/node_buffer.h:67:40: note: candidate function not viable: requires 3 arguments, but 1 was provided
NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
                                       ^
/Users/****/.node-gyp/8.12.0/include/node/node_buffer.h:60:40: note: candidate function not viable: requires 5 arguments, but 1 was provided
NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
                                       ^
In file included from ../fsevents.cc:6:
../../nan/nan.h:427:26: error: no member named 'Use' in namespace 'node::Buffer'
    return node::Buffer::Use(data, size);
           ~~~~~~~~~~~~~~^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [Release/obj.target/fse/fsevents.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/****/.nvm/versions/node/v8.12.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack     at emitTwo (events.js:126:13)
gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Darwin 18.0.0
gyp ERR! command "/Users/****/.nvm/versions/node/v8.12.0/bin/node" "/Users/****/.nvm/versions/node/v8.12.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/****/node_modules/camunda-bpm-sdk-js/node_modules/fsevents
gyp ERR! node -v v8.12.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok

Dependabot couldn't find a package.json for this project

Dependabot couldn't find a package.json for this project.

Dependabot requires a package.json to evaluate your project's current JavaScript dependencies. It had expected to find one at the path: /vendor/superagent/package.json.

If this isn't a JavaScript project, or if it is a library, you may wish to disable updates for it from within Dependabot.

You can mention @dependabot in the comments below to contact the Dependabot team.

Dependabot can't resolve your JavaScript dependency files

Dependabot can't resolve your JavaScript dependency files.

As a result, Dependabot couldn't update your dependencies.

The error Dependabot encountered was:

Error whilst updating rollup in /vendor/superagent/package-lock.json:
404 Not Found - GET https://app.camunda.com/nexus/content/groups/npm-public/@types%2festree

If you think the above is an error on Dependabot's side please don't hesitate to get in touch - we'll do whatever we can to fix it.

You can mention @dependabot in the comments below to contact the Dependabot team.

Dependabot can't resolve your JavaScript dependency files

Dependabot can't resolve your JavaScript dependency files.

As a result, Dependabot couldn't update your dependencies.

The error Dependabot encountered was:

Error whilst updating rollup in /vendor/fast-xml-parser/package-lock.json:
404 Not Found - GET https://app.camunda.com/nexus/content/groups/npm-public/@types%2festree

If you think the above is an error on Dependabot's side please don't hesitate to get in touch - we'll do whatever we can to fix it.

You can mention @dependabot in the comments below to contact the Dependabot team.

Unable to initiate process instance with a start form

I am using "camunda-invoice" as example to initiate a process instance using Form SDK. With the guildeline from Camunda Docs, I am able to render the start form. But however, when I do a submission, the REST API (http://localhost:8080/engine-rest/engine/default/process-definition/.../submit-form) returns me HTTP Status 500.

I am tried to troubleshoot, and I noticed that one of variable - "invoiceCategory" (which is the variable to hold the selected option on HTML Select element) is submitted as null. The root cause to this is the "getValue" function in "lib/forms/controls/choices-field-handler.js"

At least the following solution work at my end, but just to confirm should we rectify this value = this.element.find('option:selected').attr('value');//.val(); statement to value = this.element.find('option:selected').val();?

Dependabot couldn't find a package.json for this project

Dependabot couldn't find a package.json for this project.

Dependabot requires a package.json to evaluate your project's current JavaScript dependencies. It had expected to find one at the path: /vendor/superagent/package.json.

If this isn't a JavaScript project, or if it is a library, you may wish to disable updates for it from within Dependabot.

You can mention @dependabot in the comments below to contact the Dependabot team.

Dependabot couldn't find a package.json for this project

Dependabot couldn't find a package.json for this project.

Dependabot requires a package.json to evaluate your project's current JavaScript dependencies. It had expected to find one at the path: /vendor/superagent/package.json.

If this isn't a JavaScript project, or if it is a library, you may wish to disable updates for it from within Dependabot.

You can mention @dependabot in the comments below to contact the Dependabot team.

AngularJS is loaded twice in client setup

I'm building a small app using CamSDK as a module imported via:

import angular from 'angular';
import CamSDK from 'camunda-bpm-sdk-js/lib/angularjs/index.js';

angular
    .module('app', ['cam.embedded.forms'])
    .constant('CamSDK', CamSDK)
    ...

Unfortunately, this leads to angular being called twice during application startup.

WARNING: Tried to load angular more than once.

It also bloats the app build via Webpack as the angular source code is included twice (this can be mitigated for production via dedup but loading angular twice still is a problem).

As a test I commented out the line that requires angular trusting that the angular object would be available as a peerDependency and all works nicely.

To make better use of the angular components, I would suggest to add angular as a peerDependency instead of an optionalDependency and use it as a global object. Also, it may make sense to migrate Angular-related stuff into a separate package? This would also allow to set the correct main option to load the angular component. Right now, this needs to be adjusted in the import path (see above) or via overriding the package.json/main key via the module loader/builder of your choice.

Edit: I just noticed that Angular 1.2.29 is loaded as an optionalDependency and installed in the packages node_modules folder. I assume this is the second instance of angular that is loaded in parallel to my peer dependency of 1.5.9.

History variables

Hi!
Can't make pull request.
So here it is the diff to lib/api-client/resources/history.js enabling access to historical vars

@@ -449,5 +449,123 @@ History.taskCount = function(params, done) {
};

/**

  • Get variable instances
    *
  • @param {Object} params
    *
  • @param {String} [params.variableName] Filter by variable instance name.
    *
  • @param {String} [params.variableNameLike] Filter by the variable instance name.
  •                                                      The parameter can include the wildcard %
    
  •                                                      to express like-strategy such as:
    
  •                                                      - starts with (%name)
    
  •                                                      - ends with (name%)
    
  •                                                      - contains (%name%).
    
  • @param {String[]} [params.processInstanceIdIn] Only include variable instances which
  •                                                      belong to one of the passed and
    
  •                                                      comma-separated process instance ids.
    
  • @param {String[]} [params.executionIdIn] Only include variable instances which
  •                                                      belong to one of the passed and
    
  •                                                      comma-separated execution ids.
    
  • @param {String[]} [params.caseInstanceIdIn] Only include variable instances which
  •                                                      belong to one of the passed
    
  •                                                      case instance ids.
    
  • @param {String[]} [params.caseExecutionIdIn] Only include variable instances which
  •                                                      belong to one of the passed
    
  •                                                      case execution ids.
    
  • @param {String[]} [params.taskIdIn] Only include variable instances which
  •                                                      belong to one of the passed and
    
  •                                                      comma-separated task ids.
    
  • @param {String[]} [params.activityInstanceIdIn] Only include variable instances which
  •                                                      belong to one of the passed and
    
  •                                                      comma-separated activity instance ids.
    
  • @param {String} [params.variableValues] Only include variable instances that
  •                                                      have the certain values. Value filtering
    
  •                                                      expressions are comma-separated and are
    
  •                                                      structured as follows:
    
  •                                                      A valid parameter value has the form
    
  •                                                      key_operator_value.
    
  •                                                      key is the variable name,
    
  •                                                      operator is the comparison operator to
    
  •                                                      be used and value the variable value.
    
  •                                                      _Note_: Values are always treated as
    
  •                                                      String objects on server side.
    
  •                                                      Valid operator values are:
    
  •                                                      - eq - equal to
    
  •                                                      - neq - not equal to
    
  •                                                      - gt - greater than
    
  •                                                      - gteq - greater than or equal to
    
  •                                                      - lt - lower than
    
  •                                                      - lteq - lower than or equal to
    
  •                                                      key and value may not contain underscore
    
  •                                                      or comma characters.
    
  • @param {String} [params.sortBy] Sort the results lexicographically by a
  •                                                      given criterion. Valid values are
    
  •                                                      variableName, variableType and
    
  •                                                      activityInstanceId.
    
  •                                                      Must be used in conjunction with the
    
  •                                                      sortOrder parameter.
    
  • @param {String} [params.sortOrder] Sort the results in a given order.
  •                                                      Values may be asc for ascending order or
    
  •                                                      desc for descending order.
    
  •                                                      Must be used in conjunction with the
    
  •                                                      sortBy parameter.
    
  • @param {String} [params.firstResult] Pagination of results. Specifies the
  •                                                      index of the first result to return.
    
  • @param {String} [params.maxResults] Pagination of results. Specifies the
  •                                                      maximum number of results to return.
    
  •                                                      Will return less results if there are no
    
  •                                                      more results left.
    
  • @param {String} [params.deserializeValues] Determines whether serializable variable
  •                                                      values (typically variables that store
    
  •                                                      custom Java objects) should be
    
  •                                                      deserialized on server side
    
  •                                                      (default true).
    
  •                                                      If set to true, a serializable variable
    
  •                                                      will be deserialized on server side and
    
  •                                                      transformed to JSON using
    
  •                                                      Jackson's POJO/bean property
    
  •                                                      introspection feature.
    
  •                                                      Note that this requires the Java classes
    
  •                                                      of the variable value to be on the
    
  •                                                      REST API's classpath.
    
  •                                                      If set to false, a serializable variable
    
  •                                                      will be returned in its serialized
    
  •                                                      format.
    
  •                                                      For example, a variable that is
    
  •                                                      serialized as XML will be returned as a
    
  •                                                      JSON string containing XML.
    
  •                                                      Note:While true is the default value for
    
  •                                                      reasons of backward compatibility, we
    
  •                                                      recommend setting this parameter to
    
  •                                                      false when developing web applications
    
  •                                                      that are independent of the Java process
    
  •                                                      applications deployed to the engine.
    
  • @param {RequestCallback} done
    */
    History.variableInstances = function(data, done) {
    return this.http.post(this.path + '/variable-instance', {
    data: data,
    done: done
    });
    };

module.exports = History;

Publish package to NPM

There is a previously closed issue regarding this (#21) however I am not satisfied with using npm i -d camunda/camunda-bpm-sdk-js as it does not allow for any versioning of the dependency. Yes, I could indicate a specific commit but that is approximately 1 million times more annoying to maintain.

Is there a reason why this is not published on NPM?

Recent commit for CSRF breaks SDK when used in node

The following commit is breaking the http client for those who use the SDK in node:

501705d#diff-3fb897b73c45f2d1378d1bfa9d61a482

I'd appreciate it if you could fix this. In particular, document is not defined when using node because node has no notion of a document.

7/3/2018 10:31:40 AMTue, 03 Jul 2018 14:31:40 GMT @complion:chili:src:middlewares:apollo:index ReferenceError: document is not defined
7/3/2018 10:31:40 AM    at cookies (/app/node_modules/camunda-bpm-sdk-js/lib/api-client/http-client.js:42:3)
7/3/2018 10:31:40 AM    at prepareRequestHeaders (/app/node_modules/camunda-bpm-sdk-js/lib/api-client/http-client.js:66:16)
7/3/2018 10:31:40 AM    at HttpClient.load (/app/node_modules/camunda-bpm-sdk-js/lib/api-client/http-client.js:168:17)
7/3/2018 10:31:40 AM    at HttpClient.get (/app/node_modules/camunda-bpm-sdk-js/lib/api-client/http-client.js:154:15)
7/3/2018 10:31:40 AM    at Function.getByKey (/app/node_modules/camunda-bpm-sdk-js/lib/api-client/resources/process-definition.js:117:24)
7/3/2018 10:31:40 AM    at CamundaConnector.getProcessDefinition (/app/src/gql/connectors/camunda.js:350:48)
7/3/2018 10:31:40 AM    at FormLoader.loadProcessForm (/app/src/gql/models/workflow/FormLoader.js:28:65)
7/3/2018 10:31:40 AM    at FormLoader.getForm (/app/src/gql/models/workflow/FormLoader.js:17:29)
7/3/2018 10:31:40 AM    at WorkflowManager.getForm (/app/src/gql/models/workflow/WorkflowManager.js:31:33)
7/3/2018 10:31:40 AM    at getForm (/app/src/gql/schema/queries/resolvers/form.js:22:28)
7/3/2018 10:31:40 AM    at resolveFieldValueOrError (/app/node_modules/graphql/execution/execute.js:498:12)
7/3/2018 10:31:40 AM    at resolveField (/app/node_modules/graphql/execution/execute.js:462:16)
7/3/2018 10:31:40 AM    at /app/node_modules/graphql/execution/execute.js:311:18
7/3/2018 10:31:40 AM    at Array.reduce (<anonymous>)
7/3/2018 10:31:40 AM    at executeFields (/app/node_modules/graphql/execution/execute.js:308:42)
7/3/2018 10:31:40 AM    at executeOperation (/app/node_modules/graphql/execution/execute.js:236:122)
7/3/2018 10:31:40 AM    at executeImpl (/app/node_modules/graphql/execution/execute.js:133:26)
7/3/2018 10:31:40 AM    at Object.execute (/app/node_modules/graphql/execution/execute.js:110:229)
7/3/2018 10:31:40 AM    at doRunQuery (/app/node_modules/apollo-server-core/dist/runQuery.js:122:42)
7/3/2018 10:31:40 AM    at /app/node_modules/apollo-server-core/dist/runQuery.js:21:56
7/3/2018 10:31:40 AM    at <anonymous>
7/3/2018 10:31:40 AM    at process._tickDomainCallback (internal/process/next_tick.js:228:7)

Looks to me like the variable does not append the necessary query parameters

This is in the variable variable resource. The following config parameters need to be appended onto the query string. This is correctly done in the history resource. See below

If this is not something you can take care of immediately, I may open a pull request.

History.variableInstance = function(params, done) {
  if (typeof params === 'function') {
    done = arguments[0];
    params = {};
  }

  var body = {};
  var query = {};
  var queryParams = ['firstResult', 'maxResults', 'deserializeValues'];

  for (var p in params) {
    if (queryParams.indexOf(p) > -1) {
      query[p] = params[p];
    }
    else {
      body[p] = params[p];
    }
  }

  return this.http.post(this.path + '/variable-instance', {
    data: body,
    query: query,
    done: done
  });
};

What is the intended behavior of returns for HttpClient?

Many calls to HttpClient is returned (62 from a rough count), a few examples:

Task.get = function(taskId, done) {
  return this.http.get(this.path +'/'+ taskId, {
    done: done
  });
};

/// ... 

Task.form = function(taskId, done) {
  return this.http.get(this.path +'/'+ taskId + '/form', {
    done: done
  });
};

However, HttpClient doesn't return anything for these methods:

HttpClient.prototype.put = function(path, options) {
  // ...
  req.end(end(self, done));
};

//  Called by get: HttpClient.prototype.get
HttpClient.prototype.load = function(url, options) {
  // ...
  req.end(end(self, done));
}

HttpClient.prototype.del = function(path, options) {
  // ...
  req.end(end(self, done));
}

HttpClient.prototype.options = function(path, options) {
  // ...
  req.end(end(self, done));
};

// Post does have a return in case of an error
HttpClient.prototype.post = function(path, options) {
  // ...
  else if (!!options.fields || !!options.attachments) {
    return done(new Error('Multipart request is only supported in node.js environement.'));
  }
  req.end(end(self, done));
};

Rough count of undefined returns:

  • return this.http.get: 22
  • return this.http.post: 27 - these do have a return in case of an error
  • return this.http.put: 7
  • return this.http.del: 4
  • return this.http.options: 2

When I originally noticed these calls had returns, I was excited and thought I could implement my callbacks using promises, but was disappointed the find the returns are alway undefined. What is the intended functionality here?

bower grunt to Webpack babel and yarn

I think, for the most part, Webpack, babel and yarn are now preferred over bower and grunt. Would be great if camunda-bpm-sdk-js could be switched over to using those.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.