All Projects → jlucansky → Camunda.api.client

jlucansky / Camunda.api.client

Licence: mit
Camunda REST API Client for .NET platform

Projects that are alternatives of or similar to Camunda.api.client

Generator Swiftserver
WARNING: This repository is no longer maintained
Stars: ✭ 64 (-26.44%)
Mutual labels:  api, rest
Laravel Api Boilerplate Jwt
A Laravel 5.8 API Boilerplate to create a ready-to-use REST API in seconds.
Stars: ✭ 1,155 (+1227.59%)
Mutual labels:  api, rest
Falcon
The no-nonsense REST API and microservices framework for Python developers, with a focus on reliability, correctness, and performance at scale.
Stars: ✭ 8,654 (+9847.13%)
Mutual labels:  api, rest
Cookiecutter Django Rest
Build best practiced apis fast with Python3
Stars: ✭ 1,108 (+1173.56%)
Mutual labels:  api, rest
Spring Boot Api Project Seed
🌱🚀一个基于Spring Boot & MyBatis的种子项目,用于快速构建中小型API、RESTful API项目~
Stars: ✭ 8,979 (+10220.69%)
Mutual labels:  api, rest
Mailman
Mailman is a GUI to help you manage your email accounts stored in a MySQL/MariaDB database.
Stars: ✭ 62 (-28.74%)
Mutual labels:  api, rest
Acf To Rest Api
Exposes Advanced Custom Fields Endpoints in the WordPress REST API
Stars: ✭ 1,152 (+1224.14%)
Mutual labels:  api, rest
Api Strategy
Equinor API Strategy
Stars: ✭ 56 (-35.63%)
Mutual labels:  api, rest
Foal
Elegant and all-inclusive Node.Js web framework based on TypeScript. 🚀.
Stars: ✭ 1,176 (+1251.72%)
Mutual labels:  api, rest
Apy
Apy is a simple client-side library for making rest api ajax calls.
Stars: ✭ 68 (-21.84%)
Mutual labels:  api, rest
Rest Hapi
🚀 A RESTful API generator for Node.js
Stars: ✭ 1,102 (+1166.67%)
Mutual labels:  api, rest
Queryql
Easily add filtering, sorting, and pagination to your Node.js REST API through your old friend: the query string!
Stars: ✭ 76 (-12.64%)
Mutual labels:  api, rest
Openapi Generator
OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
Stars: ✭ 10,634 (+12122.99%)
Mutual labels:  api, rest
Yarf
Yet Another REST Framework
Stars: ✭ 62 (-28.74%)
Mutual labels:  api, rest
Api Php Client
PHP client of Akeneo PIM API
Stars: ✭ 56 (-35.63%)
Mutual labels:  api, rest
Dreamfactory
DreamFactory API Management Platform
Stars: ✭ 1,148 (+1219.54%)
Mutual labels:  api, rest
Json Api Dart
JSON:API client for Dart/Flutter
Stars: ✭ 53 (-39.08%)
Mutual labels:  api, rest
Githubapi
Swift implementation of Github REST API v3
Stars: ✭ 55 (-36.78%)
Mutual labels:  api, rest
Ratp Api Rest
This project turnkey is distributed as a middleware to expose RATP realtime data as REST resources
Stars: ✭ 68 (-21.84%)
Mutual labels:  api, rest
Huobi golang
Go SDK for Huobi Spot API
Stars: ✭ 76 (-12.64%)
Mutual labels:  api, rest

Camunda REST API Client Build status NuGet

Camunda REST API Client for .NET platform

  • [x] .NET Framework 4.6.1
  • [x] .NET Standard 2.0

Covered API

Each part listed below is fully covered according to https://docs.camunda.org/manual/latest/reference/rest specification.

Install

The Camunda REST API Client is available on nuget.org

To install Camunda REST API Client, run the following command in the Package Manager Console

PM> Install-Package Camunda.Api.Client

Usage

Initialize client

CamundaClient camunda = CamundaClient.Create("http://localhost:8080/engine-rest");

Basic Authentication

HttpClient httpClient = new HttpClient();
httpClient.BaseAddress = new Uri("http://localhost:8080/engine-rest");
httpClient.DefaultRequestHeaders.Add("Authorization", "Basic ZGVtbzpkZW1v");
CamundaClient camunda = CamundaClient.Create(httpClient);

Filter external tasks

// build query
var externalTaskQuery = new ExternalTaskQuery() { Active = true, TopicName = "MyTask" };

// add some sorting
externalTaskQuery
    .Sort(ExternalTaskSorting.TaskPriority, SortOrder.Descending)
    .Sort(ExternalTaskSorting.LockExpirationTime);

// request external tasks according to query
List<ExternalTaskInfo> tasks = await camunda.ExternalTasks.Query(externalTaskQuery).List();

Get all external tasks

// get all external tasks without specifying query
List<ExternalTaskInfo> allTasks = await camunda.ExternalTasks.Query().List();

Set process variable

VariableResource vars = camunda.ProcessInstances["0ea218e8-9cfa-11e6-90a6-ac87a31e24fd"].Variables;

// set integer variable
await vars.Set("Var1", VariableValue.FromObject(123));

// set content of binary variable from file
await vars.SetBinary("DocVar", new BinaryDataContent(File.OpenRead("document.doc")), BinaryVariableType.Bytes);

Load typed variables

var executionId = "290a7fa2-8bc9-11e6-ab5b-ac87a31e24fd";
// load all variables of specified execution
Dictionary<string, VariableValue> allVariables = await camunda.Executions[executionId]
    .LocalVariables.GetAll();

// obtain strongly typed variable with name Var1
int myVar1 = allVariables["Var1"].GetValue<int>();

Save content of variable to file

HttpContent fileContent = await camunda.Executions[executionId]
    .LocalVariables.GetBinary("file1");

using (fileContent)
{
    using (var outStream = File.OpenWrite("file1.doc"))
    {
        (await fileContent.ReadAsStreamAsync()).CopyTo(outStream);
    }
}

Message correlation

var msg = new CorrelationMessage() { All = true, MessageName = "TestMsg" };

msg.ProcessVariables
    .Set("Date", DateTime.Today)
    .Set("ComplexVar", new { abc = "xyz", num = 123});

// correlate message with process variables
await camunda.Messages.DeliverMessage(msg);

Deploy resources

// deploy new bpmn diagram with some attachment
await camunda.Deployments.Create("My Deployment 1",
    new ResourceDataContent(File.OpenRead("C:\\diagram.bpmn"), "diagram.bpmn"), 
    new ResourceDataContent(File.OpenRead("C:\\document.doc"), "document.doc"));

Conditional query

// get all jobs owned by Process_1 with DueDate in the future
var jobQuery = new JobQuery() { ProcessDefinitionKey = "Process_1" };
jobQuery.DueDates.Add(new ConditionQueryParameter() 
{
    Operator = ConditionOperator.GreaterThan, Value = DateTime.Now
});

var jobs = await camunda.Jobs.Query(jobQuery).List();

License

This project is made available under the MIT license. See LICENSE for details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].