6.2. 워크플로우 범위 이벤트 시스템 구성
워크플로우 범위의 이벤트 시스템 구성을 사용하면 특정 워크플로우에서 생성 및 사용하는 이벤트를 세부적으로 사용자 지정할 수 있습니다. SonataFlow
CR에서 spec.sink.ref
및 spec.sources[]
필드를 사용하여 발신 및 수신 이벤트를 구성할 수 있습니다.
6.2.1. 발신 이벤트 시스템 구성
발신 이벤트를 구성하려면 SonataFlow
CR에서 spec.sink.ref
필드를 사용할 수 있습니다. 이 구성을 사용하면 워크플로우에서 시스템 이벤트 및 워크플로우 비즈니스 이벤트를 포함하여 지정된 Knative Eventing 브로커를 사용하여 이벤트를 생성할 수 있습니다.
다음 예제는 워크플로우 범위 발신 이벤트 시스템에 대해 SonataFlow
CR을 구성하는 방법을 보여줍니다.
apiVersion: sonataflow.org/v1alpha08 kind: SonataFlow metadata: name: example-workflow namespace: example-workflow-namespace annotations: sonataflow.org/description: Example Workflow sonataflow.org/version: 0.0.1 sonataflow.org/profile: preview spec: sink: ref: name: outgoing-example-broker 1 namespace: outgoing-example-broker-namespace 2 apiVersion: eventing.knative.dev/v1 kind: Broker flow: 3 start: ExampleStartState events: 4 - name: outEvent1 5 source: '' kind: produced type: out-event-type1 6 ...
- 1
- SonataFlow 시스템 이벤트를 포함하여 워크플로우에서 생성한 모든 이벤트에 사용할 Knative Eventing 브로커의 이름입니다.
- 2
- Knative Eventing 브로커의 네임스페이스를 정의합니다. 값을 지정하지 않으면 매개변수의 기본값은
SonataFlow
네임스페이스입니다.SonataFlow
와 동일한 네임스페이스에 브로커를 생성하는 것이 좋습니다. - 3
SonataFlow
CR의 흐름 정의 필드입니다.- 4
SonataFlow
CR의 이벤트 정의 필드입니다.- 5
- 발신 이벤트
outEvent1
정의의 예. - 6
outEvent1
발신 이벤트의 이벤트 유형입니다.
6.2.2. 들어오는 이벤트 시스템 구성
들어오는 이벤트를 구성하려면 SonataFlow
CR에서 spec.sources[]
필드를 사용할 수 있습니다. 특정 구성이 필요한 각 이벤트 유형에 대한 항목을 추가할 수 있습니다. 이 설정을 사용하면 워크플로우에서 이벤트 유형을 기반으로 다양한 브로커의 이벤트를 사용할 수 있습니다.
들어오는 이벤트 유형에 특정 브로커 구성이 없는 경우 시스템은 이벤트 시스템 구성 우선순위 규칙을 적용합니다.
다음 예제는 워크플로우 범위 들어오는 이벤트 시스템에 대해 SonataFlow
CR을 구성하는 방법을 보여줍니다.
spec.sources[]
항목과 워크플로우 이벤트 간의 링크는 이벤트 유형을 사용하는 것입니다.
apiVersion: sonataflow.org/v1alpha08 kind: SonataFlow metadata: name: example-workflow namespace: example-workflow-namespace annotations: sonataflow.org/description: Example Workflow sonataflow.org/version: 0.0.1 sonataflow.org/profile: preview spec: sources: - eventType: in-event-type1 1 ref: name: incoming-example-broker1 2 namespace: incoming-example-broker1-namespace 3 apiVersion: eventing.knative.dev/v1 kind: Broker - eventType: in-event-type2 4 ref: name: incoming-example-broker2 5 namespace: incoming-example-broker2-namespace 6 apiVersion: eventing.knative.dev/v1 kind: Broker flow: 7 start: ExampleStartState events: 8 - name: inEvent1 9 source: '' kind: consumed type: in-event-type1 10 - name: inEvent2 11 source: '' kind: consumed type: in-event-type2 12 ...
- 1
- 지정된 Knative Eventing 브로커를 사용하여
in-event-type1
유형의 이벤트를 사용하도록 워크플로우를 구성합니다. - 2
- 이 워크플로우로 전송된 type
in-event-type1
유형의 이벤트 사용에 사용할 Knative Eventing 브로커의 이름입니다. - 3
- 선택 사항: 값을 지정하지 않으면 매개변수의 기본값은
SonataFlow
네임스페이스입니다.SonataFlow
워크플로우와 동일한 네임스페이스에 브로커를 생성하는 것이 좋습니다. - 4
- 지정된 Knative Eventing 브로커를 사용하여
in-event-type2
유형의 이벤트를 사용하도록 워크플로우를 구성합니다. - 5
- 이 워크플로우로 전송되는 type
in-event-type2
의 이벤트 사용에 사용할 Knative Eventing 브로커의 이름입니다. - 6
- 선택 사항: 값을 지정하지 않으면 매개변수의 기본값은
SonataFlow
네임스페이스입니다.SonataFlow
워크플로우와 동일한 네임스페이스에 브로커를 생성하는 것이 좋습니다. - 7
SonataFlow
CR의 흐름 정의 필드입니다.- 8
SonataFlow
CR의 이벤트 정의 필드입니다.- 9
- 이벤트
inEvent1
정의의 예. - 10
- 들어오는 이벤트
inEvent1
의 이벤트 유형입니다. 해당spec.sources[]
항목이 있는 워크플로우 이벤트의 링크는 이벤트 유형 이름in-event-type1
을 사용하는 것입니다. - 11
- 이벤트
inEvent2
정의의 예. - 12
- 들어오는 이벤트
inEvent2
의 이벤트 유형입니다. 해당 spec.sources[] 항목이 있는 워크플로우 이벤트 링크는 이벤트 유형 이름 in-event-type2를 사용하여 생성됩니다.