Symphony Camunda Client

Symphony Camunda Client provided by Symphony Platform Solutions team

License

License

Categories

Categories

CLI User Interface ORM Data
GroupId

GroupId

com.symphony.platformsolutions
ArtifactId

ArtifactId

symphony-camunda-client
Last Version

Last Version

1.0.3
Release Date

Release Date

Type

Type

jar
Description

Description

Symphony Camunda Client
Symphony Camunda Client provided by Symphony Platform Solutions team
Project URL

Project URL

https://github.com/SymphonyPlatformSolutions/symphony-camunda-client
Source Code Management

Source Code Management

https://github.com/SymphonyPlatformSolutions/symphony-camunda-client

Download symphony-camunda-client

How to add to project

<!-- https://jarcasting.com/artifacts/com.symphony.platformsolutions/symphony-camunda-client/ -->
<dependency>
    <groupId>com.symphony.platformsolutions</groupId>
    <artifactId>symphony-camunda-client</artifactId>
    <version>1.0.3</version>
</dependency>
// https://jarcasting.com/artifacts/com.symphony.platformsolutions/symphony-camunda-client/
implementation 'com.symphony.platformsolutions:symphony-camunda-client:1.0.3'
// https://jarcasting.com/artifacts/com.symphony.platformsolutions/symphony-camunda-client/
implementation ("com.symphony.platformsolutions:symphony-camunda-client:1.0.3")
'com.symphony.platformsolutions:symphony-camunda-client:jar:1.0.3'
<dependency org="com.symphony.platformsolutions" name="symphony-camunda-client" rev="1.0.3">
  <artifact name="symphony-camunda-client" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.symphony.platformsolutions', module='symphony-camunda-client', version='1.0.3')
)
libraryDependencies += "com.symphony.platformsolutions" % "symphony-camunda-client" % "1.0.3"
[com.symphony.platformsolutions/symphony-camunda-client "1.0.3"]

Dependencies

compile (6)

Group / Artifact Type Version
org.slf4j : slf4j-api jar 1.7.25
org.glassfish.jersey.core : jersey-client jar 2.29
org.glassfish.jersey.media : jersey-media-json-jackson jar 2.29
org.glassfish.jersey.media : jersey-media-multipart jar 2.29
com.symphony.platformsolutions : symphony-api-client-java jar [1.0.0,)
org.camunda.bpm : camunda-external-task-client jar 1.2.0

test (1)

Group / Artifact Type Version
junit : junit jar 4.12

Project Modules

There are no modules declared in this project.

symphony-camunda-client

Library for integration with Camunda REST API for Symphony bots that follow a workflow.

Provides access to the Camunda REST APIs in order to gather the process instance that belongs a to a user in Symphony Stream and if a user task is present action it.

Install using maven

<dependency>
    <groupId>com.symphony.platformsolutions</groupId>
    <artifactId>symphony-camunda-client</artifactId>
    <version>1.0.2</version>
</dependency>

Configuration

Create a camunda-config.json file in your project which includes the following property

{
  "camundaURL": "http://localhost:8080/engine-rest"
}

Usage

  1. First step is deploying your bpmn files to the camunda engine.
  2. Add this code to your message handler in the Symphony bot code:
ProcessInstance instance = processInstanceClient.getProcessInstance(inboundMessage.getStream().getStreamId().replace("_", "%"));
if (instance == null) {
    if (action != null) {
        ProcessDefinitionInfo info = processInstanceClient.getProcessDefinitionIdFromDeploymentName(action.getAction());
        Map<String, ValueType> variableMap = new HashMap<>();
        variableMap.put("streamId", new ValueType(inboundMessage.getStream().getStreamId().replace("_", "%")));
        variableMap.put("email", new ValueType(inboundMessage.getUser().getEmail()));
        for (String parameter : action.getParameters().keySet()) {
            variableMap.put(parameter, new ValueType(action.getParameters().get(parameter)));
        }
        processInstanceClient.startProcessInstance(variableMap, info.getId());
    }
} else {
    if(action!=null){
        processInstanceClient.setProcessVariable(instance.getId(),action.getAction(),"true");
    }

    for (String parameter : action.getParameters().keySet()) {
        processInstanceClient.setProcessVariable(instance.getId(),parameter,action.getParameters().get(parameter));
    }
    Task task = taskClient.getTask(instance.getId(), inboundMessage.getUser().getEmail());
    System.out.println(task.getId());
    taskClient.completeTask(task.getId());
}
com.symphony.platformsolutions

Symphony Platform Solutions

Symphony supported software client, bots, apps, and examples.

Versions

Version
1.0.3
1.0.2
1.0.1
1.0.0