Skip to content

Commit db38b05

Browse files
committed
KOALA-3922: Update documentation
1 parent aa6ba9c commit db38b05

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

collections/_sdk/effects/data_integration.md

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -53,21 +53,18 @@ from canvas_sdk.effects.data_integration import AssignDocumentReviewer, Priority
5353
from canvas_sdk.events import EventType
5454
from canvas_sdk.protocols import BaseProtocol
5555

56-
from canvas_sdk.v1.data.integration_task import IntegrationTask
5756
from canvas_sdk.v1.data.staff import Staff
5857

5958

6059
class Protocol(BaseProtocol):
61-
RESPONDS_TO = [
62-
EventType.Name(EventType.INTEGRATION_TASK_CREATED),
63-
]
60+
RESPONDS_TO = EventType.Name(EventType.DOCUMENT_RECEIVED)
6461

6562
def compute(self) -> list[Effect]:
66-
integration_task = IntegrationTask.objects.get(id=self.target)
63+
document_id = self.event.context.get("document", {}).get("id")
6764
reviewer = Staff.objects.get(last_name="Smith")
6865

6966
assign_reviewer = AssignDocumentReviewer(
70-
document_id=integration_task.id,
67+
document_id=document_id,
7168
reviewer_id=reviewer.id,
7269
priority=Priority.NORMAL,
7370
review_mode=ReviewMode.REVIEW_REQUIRED,
@@ -84,21 +81,18 @@ from canvas_sdk.effects.data_integration import AssignDocumentReviewer, Priority
8481
from canvas_sdk.events import EventType
8582
from canvas_sdk.protocols import BaseProtocol
8683

87-
from canvas_sdk.v1.data.integration_task import IntegrationTask
8884
from canvas_sdk.v1.data.team import Team
8985

9086

9187
class Protocol(BaseProtocol):
92-
RESPONDS_TO = [
93-
EventType.Name(EventType.INTEGRATION_TASK_CREATED),
94-
]
88+
RESPONDS_TO = EventType.Name(EventType.DOCUMENT_RECEIVED)
9589

9690
def compute(self) -> list[Effect]:
97-
integration_task = IntegrationTask.objects.get(id=self.target)
91+
document_id = self.event.context.get("document", {}).get("id")
9892
team = Team.objects.get(name="Document Review")
9993

10094
assign_reviewer = AssignDocumentReviewer(
101-
document_id=integration_task.id,
95+
document_id=document_id,
10296
team_id=team.id,
10397
priority=Priority.HIGH,
10498
)

0 commit comments

Comments
 (0)