-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add signals + subscriptions to GraphQL API
Expose signals and signal subscriptions via GraphQL API.
- Loading branch information
Showing
22 changed files
with
561 additions
and
148 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package io.zeebe.zeeqs.data.entity | ||
|
||
import javax.persistence.Column | ||
import javax.persistence.Entity | ||
import javax.persistence.Id | ||
|
||
@Entity | ||
class Signal( | ||
@Id @Column(name = "key_") val key: Long, | ||
val position: Long, | ||
val name: String, | ||
var timestamp: Long | ||
) |
17 changes: 17 additions & 0 deletions
17
data/src/main/kotlin/io/zeebe/zeeqs/data/entity/SignalSubscription.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package io.zeebe.zeeqs.data.entity | ||
|
||
import javax.persistence.* | ||
|
||
@Entity | ||
class SignalSubscription( | ||
@Id @Column(name = "key_") val key: Long, | ||
val position: Long, | ||
val signalName: String, | ||
val processDefinitionKey: Long, | ||
val elementId: String | ||
) { | ||
|
||
@Enumerated(EnumType.STRING) | ||
var state: SignalSubscriptionState = SignalSubscriptionState.CREATED | ||
var timestamp: Long = -1 | ||
} |
6 changes: 6 additions & 0 deletions
6
data/src/main/kotlin/io/zeebe/zeeqs/data/entity/SignalSubscriptionState.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package io.zeebe.zeeqs.data.entity | ||
|
||
enum class SignalSubscriptionState { | ||
CREATED, | ||
DELETED | ||
} |
15 changes: 15 additions & 0 deletions
15
data/src/main/kotlin/io/zeebe/zeeqs/data/entity/SignalVariable.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package io.zeebe.zeeqs.data.entity | ||
|
||
import javax.persistence.Column | ||
import javax.persistence.Entity | ||
import javax.persistence.Id | ||
import javax.persistence.Lob | ||
|
||
@Entity | ||
class SignalVariable( | ||
@Id val id: String, | ||
val name: String, | ||
@Lob @Column(name = "value_") val value: String, | ||
val signalKey: Long, | ||
val position: Long | ||
) |
10 changes: 10 additions & 0 deletions
10
data/src/main/kotlin/io/zeebe/zeeqs/data/repository/SignalRepository.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package io.zeebe.zeeqs.data.repository | ||
|
||
import io.zeebe.zeeqs.data.entity.Signal | ||
import org.springframework.data.repository.PagingAndSortingRepository | ||
import org.springframework.stereotype.Repository | ||
|
||
@Repository | ||
interface SignalRepository : PagingAndSortingRepository<Signal, Long> { | ||
|
||
} |
17 changes: 17 additions & 0 deletions
17
data/src/main/kotlin/io/zeebe/zeeqs/data/repository/SignalSubscriptionRepository.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package io.zeebe.zeeqs.data.repository | ||
|
||
import io.zeebe.zeeqs.data.entity.SignalSubscription | ||
import org.springframework.data.repository.PagingAndSortingRepository | ||
import org.springframework.stereotype.Repository | ||
|
||
@Repository | ||
interface SignalSubscriptionRepository : PagingAndSortingRepository<SignalSubscription, Long> { | ||
|
||
fun findByProcessDefinitionKey(processDefinitionKey: Long): List<SignalSubscription> | ||
|
||
fun findByProcessDefinitionKeyAndSignalName( | ||
processDefinitionKey: Long, | ||
signalName: String | ||
): SignalSubscription? | ||
|
||
} |
12 changes: 12 additions & 0 deletions
12
data/src/main/kotlin/io/zeebe/zeeqs/data/repository/SignalVariableRepository.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package io.zeebe.zeeqs.data.repository | ||
|
||
import io.zeebe.zeeqs.data.entity.SignalVariable | ||
import org.springframework.data.repository.PagingAndSortingRepository | ||
import org.springframework.stereotype.Repository | ||
|
||
@Repository | ||
interface SignalVariableRepository : PagingAndSortingRepository<SignalVariable, String> { | ||
|
||
fun findBySignalKey(signalKey: Long): List<SignalVariable> | ||
|
||
} |
17 changes: 9 additions & 8 deletions
17
data/src/main/kotlin/io/zeebe/zeeqs/data/service/BpmnElementMetadata.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
package io.zeebe.zeeqs.data.service | ||
|
||
data class BpmnElementMetadata( | ||
val jobType: String? = null, | ||
val conditionExpression: String? = null, | ||
val timerDefinition: String? = null, | ||
val errorCode: String? = null, | ||
val calledProcessId: String? = null, | ||
val messageSubscriptionDefinition: MessageSubscriptionDefinition? = null, | ||
val userTaskAssignmentDefinition: UserTaskAssignmentDefinition? = null, | ||
val userTaskForm: UserTaskForm? = null | ||
val jobType: String? = null, | ||
val conditionExpression: String? = null, | ||
val timerDefinition: String? = null, | ||
val errorCode: String? = null, | ||
val calledProcessId: String? = null, | ||
val messageSubscriptionDefinition: MessageSubscriptionDefinition? = null, | ||
val userTaskAssignmentDefinition: UserTaskAssignmentDefinition? = null, | ||
val userTaskForm: UserTaskForm? = null, | ||
val signalName: String? = null | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
graphql-api/src/main/kotlin/io/zeebe/zeeqs/graphql/resolvers/connection/SignalConnection.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package io.zeebe.zeeqs.graphql.resolvers.connection | ||
|
||
import io.zeebe.zeeqs.data.entity.Signal | ||
|
||
class SignalConnection( | ||
val getItems: () -> List<Signal>, | ||
val getCount: () -> Long | ||
) |
20 changes: 20 additions & 0 deletions
20
...i/src/main/kotlin/io/zeebe/zeeqs/graphql/resolvers/connection/SignalConnectionResolver.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package io.zeebe.zeeqs.graphql.resolvers.connection | ||
|
||
import io.zeebe.zeeqs.data.entity.Signal | ||
import org.springframework.graphql.data.method.annotation.SchemaMapping | ||
import org.springframework.stereotype.Controller | ||
|
||
@Controller | ||
class SignalConnectionResolver { | ||
|
||
@SchemaMapping(typeName = "SignalConnection", field = "nodes") | ||
fun nodes(connection: SignalConnection): List<Signal> { | ||
return connection.getItems() | ||
} | ||
|
||
@SchemaMapping(typeName = "SignalConnection", field = "totalCount") | ||
fun totalCount(connection: SignalConnection): Long { | ||
return connection.getCount() | ||
} | ||
|
||
} |
Oops, something went wrong.