camunda-external-task-client-js
Advanced tools
Comparing version 2.1.1 to 2.2.0
# Changelog | ||
## 2.2.0 | ||
### Features | ||
- Support setting transient variables via API ([#244](https://github.com/camunda/camunda-external-task-client-js/pull/244)) | ||
## 2.1.1 | ||
@@ -4,0 +8,0 @@ ### Bug Fixes |
@@ -133,2 +133,23 @@ # Variables | ||
## `variables.setTransient(variableName, value)` | ||
Sets a value for the variable with key _variableName_, also sets transient flag true to variable. | ||
> **Note:** The variable type is determined automatically. | ||
```js | ||
variables.setTransient("fullName", { first: "John", last: "Doe" }); | ||
console.log(variables.getTyped("fullName")); | ||
``` | ||
Output: | ||
```js | ||
{ | ||
value: { first: "John", last: "Doe" }, | ||
type: "json", | ||
valueInfo: {transient: true} | ||
} | ||
``` | ||
## `variables.setTyped(variableName, typedValue)` | ||
@@ -135,0 +156,0 @@ |
@@ -105,2 +105,18 @@ /* | ||
/** | ||
* Sets value for variable corresponding to variableName | ||
* The type is determined automatically | ||
* The variable has transient flag: true | ||
* @param variableName | ||
* @param value | ||
*/ | ||
this.setTransient = (variableName, value) => { | ||
const type = getVariableType(value); | ||
return this.setTyped(variableName, { | ||
type, | ||
value, | ||
valueInfo: { transient: true } | ||
}); | ||
}; | ||
/** | ||
* Sets the values of multiple variables at once | ||
@@ -107,0 +123,0 @@ * The new values are merged with existing ones |
@@ -146,2 +146,13 @@ /* | ||
it('setTransient("fooTransient", "fooValueTransient")) should set variable with key "fooTransient" and value "fooValueTransient" and transient "true"', () => { | ||
// given | ||
expect(variables.getAllTyped()).toMatchSnapshot("variables"); | ||
expect(variables.getDirtyVariables()).toMatchSnapshot("dirty variables"); | ||
variables.setTransient("fooTransient", "fooValueTransient"); | ||
// then | ||
expect(variables.getAllTyped()).toMatchSnapshot("variables"); | ||
expect(variables.getDirtyVariables()).toMatchSnapshot("dirty variables"); | ||
}); | ||
it("setAll(someValues) should add someValues to variables", () => { | ||
@@ -148,0 +159,0 @@ // given |
{ | ||
"version": "2.1.1", | ||
"version": "2.2.0", | ||
"name": "camunda-external-task-client-js", | ||
@@ -4,0 +4,0 @@ "main": "index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3388
231570
54
1