Skip to content

Commit

Permalink
Zeeqs 2.0.0 (#135)
Browse files Browse the repository at this point in the history
* feat(hazelcast): import process instead of deployment records

* refactor(hazelcast): import only events

* feat(hazelcast): import subscriptions with key

* feat(hazelcast): map all BPMN element types

* refactor(data/graphql): rename workflow to process

* feat(data): import message variables

* feat(graphql): find message subscription by process

* build(maven): fix scm links
  • Loading branch information
saig0 authored May 28, 2021
1 parent 779ca0e commit e7e1fef
Show file tree
Hide file tree
Showing 75 changed files with 976 additions and 773 deletions.
70 changes: 35 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ A query can be send via HTTP POST request and a JSON body containing the `query`
curl \
-X POST \
-H "Content-Type: application/json" \
--data '{ "query": "{ workflows { nodes { key } } }" }' \
--data '{ "query": "{ processes { nodes { key } } }" }' \
http://localhost:9000/graphql
```

Expand All @@ -30,14 +30,14 @@ http://localhost:9000/graphiql
### Queries

The API provide the following queries:
* workflows
* workflowInstances
* processes
* processInstances
* jobs
* messages
* incidents
* errors

And additional queries to request a single object by its key (e.g. `workflow(key: "2251799813685249")`).
And additional queries to request a single object by its key (e.g. `process(key: "2251799813685249")`).

### Pagination

Expand All @@ -47,7 +47,7 @@ In addition to the items, the query result contains also the total count of the

```graphql
{
workflows(perPage: 10, page: 0) {
processes(perPage: 10, page: 0) {
totalCount
nodes {
key
Expand All @@ -62,7 +62,7 @@ Some queries allow to filter the result by passing arguments in the query.

```graphql
{
workflowInstances(stateIn: [ACTIVATED]) {
processInstances(stateIn: [ACTIVATED]) {
nodes {
key
}
Expand All @@ -72,17 +72,17 @@ Some queries allow to filter the result by passing arguments in the query.

### Examples

Get workflows including their workflow instance count:
Get processes including their process instance count:

```graphql
{
workflows {
processes {
totalCount
nodes {
key
bpmnProcessId
version
workflowInstances {
processInstances {
totalCount
}
}
Expand All @@ -97,30 +97,30 @@ Get workflows including their workflow instance count:
```
{
"data": {
"workflows": {
"processes": {
"totalCount": 3,
"nodes": [
{
"key": "2251799813685249",
"bpmnProcessId": "demo-process",
"version": 1,
"workflowInstances": {
"processInstances": {
"totalCount": 3
}
},
{
"key": "2251799813685251",
"bpmnProcessId": "demo-2",
"version": 1,
"workflowInstances": {
"processInstances": {
"totalCount": 2
}
},
{
"key": "2251799813685269",
"bpmnProcessId": "demo-3",
"version": 1,
"workflowInstances": {
"processInstances": {
"totalCount": 1
}
}
Expand All @@ -133,16 +133,16 @@ Get workflows including their workflow instance count:
</p>
</details>

Get workflow instances that are active including their active element instances:
Get process instances that are active including their active element instances:

```graphql
{
workflowInstances(stateIn: [ACTIVATED]) {
processInstances(stateIn: [ACTIVATED]) {
totalCount
nodes {
key
state
workflow {
process {
bpmnProcessId
}
elementInstances(stateIn: [ACTIVATED]) {
Expand All @@ -163,13 +163,13 @@ Get workflow instances that are active including their active element instances:
```
{
"data": {
"workflowInstances": {
"processInstances": {
"totalCount": 6,
"nodes": [
{
"key": "2251799813685261",
"state": "ACTIVATED",
"workflow": {
"process": {
"bpmnProcessId": "demo-process"
},
"elementInstances": [
Expand All @@ -190,7 +190,7 @@ Get workflow instances that are active including their active element instances:
{
"key": "2251799813685271",
"state": "ACTIVATED",
"workflow": {
"process": {
"bpmnProcessId": "demo-2"
},
"elementInstances": [
Expand All @@ -211,7 +211,7 @@ Get workflow instances that are active including their active element instances:
{
"key": "2251799813685277",
"state": "ACTIVATED",
"workflow": {
"process": {
"bpmnProcessId": "demo-2"
},
"elementInstances": [
Expand All @@ -232,7 +232,7 @@ Get workflow instances that are active including their active element instances:
{
"key": "2251799813685287",
"state": "ACTIVATED",
"workflow": {
"process": {
"bpmnProcessId": "demo-3"
},
"elementInstances": [
Expand All @@ -253,7 +253,7 @@ Get workflow instances that are active including their active element instances:
{
"key": "2251799813685304",
"state": "ACTIVATED",
"workflow": {
"process": {
"bpmnProcessId": "demo-process"
},
"elementInstances": [
Expand All @@ -274,7 +274,7 @@ Get workflow instances that are active including their active element instances:
{
"key": "2251799813685310",
"state": "ACTIVATED",
"workflow": {
"process": {
"bpmnProcessId": "demo-process"
},
"elementInstances": [
Expand Down Expand Up @@ -314,9 +314,9 @@ Get jobs that are activate (i.e. not completed or canceled) and have one of the
elementInstance {
elementId
elementName
workflowInstance {
processInstance {
key
workflow {
process {
key
bpmnProcessId
}
Expand Down Expand Up @@ -344,9 +344,9 @@ Get jobs that are activate (i.e. not completed or canceled) and have one of the
"elementInstance": {
"elementId": "ServiceTask_19bf066",
"elementName": "task 1",
"workflowInstance": {
"processInstance": {
"key": "2251799813685277",
"workflow": {
"process": {
"key": "2251799813685251",
"bpmnProcessId": "demo-2"
}
Expand All @@ -360,9 +360,9 @@ Get jobs that are activate (i.e. not completed or canceled) and have one of the
"elementInstance": {
"elementId": "ServiceTask_0t5azxx",
"elementName": "task 2",
"workflowInstance": {
"processInstance": {
"key": "2251799813685287",
"workflow": {
"process": {
"key": "2251799813685269",
"bpmnProcessId": "demo-3"
}
Expand All @@ -376,9 +376,9 @@ Get jobs that are activate (i.e. not completed or canceled) and have one of the
"elementInstance": {
"elementId": "ServiceTask_0m7fzva",
"elementName": "task 1",
"workflowInstance": {
"processInstance": {
"key": "2251799813685310",
"workflow": {
"process": {
"key": "2251799813685249",
"bpmnProcessId": "demo-process"
}
Expand All @@ -392,9 +392,9 @@ Get jobs that are activate (i.e. not completed or canceled) and have one of the
"elementInstance": {
"elementId": "ServiceTask_0f8l2yf",
"elementName": "task 3",
"workflowInstance": {
"processInstance": {
"key": "2251799813685261",
"workflow": {
"process": {
"key": "2251799813685249",
"bpmnProcessId": "demo-process"
}
Expand All @@ -408,9 +408,9 @@ Get jobs that are activate (i.e. not completed or canceled) and have one of the
"elementInstance": {
"elementId": "ServiceTask_01flslu",
"elementName": "task 2",
"workflowInstance": {
"processInstance": {
"key": "2251799813685304",
"workflow": {
"process": {
"key": "2251799813685249",
"bpmnProcessId": "demo-process"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ enum class BpmnElementType {
UNSPECIFIED,
PROCESS,
SUB_PROCESS,
EVENT_SUB_PROCESS,
START_EVENT,
INTERMEDIATE_CATCH_EVENT,
BOUNDARY_EVENT,
Expand Down
21 changes: 11 additions & 10 deletions data/src/main/kotlin/io/zeebe/zeeqs/data/entity/ElementInstance.kt
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
package io.zeebe.zeeqs.data.entity

import javax.persistence.Entity
import javax.persistence.Id
import javax.persistence.Enumerated
import javax.persistence.EnumType
import javax.persistence.Enumerated
import javax.persistence.Id

@Entity
class ElementInstance(
@Id val key: Long,
val elementId: String,
@Enumerated(EnumType.STRING)
val bpmnElementType: BpmnElementType,
val workflowInstanceKey: Long,
val workflowKey: Long,
val scopeKey: Long?
@Id val key: Long,
val position: Long,
val elementId: String,
@Enumerated(EnumType.STRING)
val bpmnElementType: BpmnElementType,
val processInstanceKey: Long,
val processDefinitionKey: Long,
val scopeKey: Long?
) {


var state: ElementInstanceState = ElementInstanceState.ACTIVATING

var startTime: Long? = null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,5 @@ enum class ElementInstanceState {
TERMINATING,
TERMINATED,

EVENT_OCCURRED,
TAKEN
}
2 changes: 1 addition & 1 deletion data/src/main/kotlin/io/zeebe/zeeqs/data/entity/Error.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ class Error(@Id val position: Long,
val errorEventPosition: Long,
@Lob val exceptionMessage: String,
@Lob val stacktrace:String,
val workflowInstanceKey: Long?
val processInstanceKey: Long?
)
13 changes: 7 additions & 6 deletions data/src/main/kotlin/io/zeebe/zeeqs/data/entity/Incident.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ import javax.persistence.Lob

@Entity
class Incident(
@Id val key: Long,
val errorType: String,
@Lob val errorMessage: String,
val workflowInstanceKey: Long,
val elementInstanceKey: Long,
val jobKey: Long?
@Id val key: Long,
val position: Long,
val errorType: String,
@Lob val errorMessage: String,
val processInstanceKey: Long,
val elementInstanceKey: Long,
val jobKey: Long?
) {

@Enumerated(EnumType.STRING)
Expand Down
9 changes: 5 additions & 4 deletions data/src/main/kotlin/io/zeebe/zeeqs/data/entity/Job.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ import javax.persistence.Id

@Entity
class Job(
@Id val key: Long,
val jobType: String,
val workflowInstanceKey: Long,
val elementInstanceKey: Long
@Id val key: Long,
val position: Long,
val jobType: String,
val processInstanceKey: Long,
val elementInstanceKey: Long
) {

@Enumerated(EnumType.STRING)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package io.zeebe.zeeqs.data.entity

enum class JobState {
ACTIVATABLE,
ACTIVATED,
FAILED,
COMPLETED,
CANCELED,
Expand Down
1 change: 1 addition & 0 deletions data/src/main/kotlin/io/zeebe/zeeqs/data/entity/Message.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import javax.persistence.Id
@Entity
class Message(
@Id val key: Long,
val position: Long,
val name: String,
val correlationKey: String?,
val messageId: String?,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ import javax.persistence.Id
class MessageCorrelation(
@Id val position: Long,
val messageKey: Long,
val messageName: String, // would favor subscriptionKey over message name + element instance key
val elementInstanceKey: Long,
val timestamp: Long
val messageName: String,
val timestamp: Long,
val processInstanceKey: Long,
val elementInstanceKey: Long?,
val elementId: String?,
val processDefinitionKey: Long?
)
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ package io.zeebe.zeeqs.data.entity

enum class MessageState {
PUBLISHED,
DELETED
EXPIRED
}
Loading

0 comments on commit e7e1fef

Please sign in to comment.