generated from camunda-community-hub/template-repo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathspacetraders-list-waypoints.bpmn
87 lines (87 loc) · 14 KB
/
spacetraders-list-waypoints.bpmn
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<?xml version="1.0" encoding="UTF-8"?>
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:zeebe="http://camunda.org/schema/zeebe/1.0" xmlns:modeler="http://camunda.org/schema/modeler/1.0" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Web Modeler" exporterVersion="08b1b84" modeler:executionPlatform="Camunda Cloud" modeler:executionPlatformVersion="8.3.0" camunda:diagramRelationId="ba031fc2-58ea-4fa9-b080-52b12dee7bd0">
<bpmn:process id="space-traders-list-waypoints" name="SpaceTraders - List waypoints" isExecutable="true">
<bpmn:startEvent id="StartEvent_1">
<bpmn:outgoing>Flow_043qgd4</bpmn:outgoing>
</bpmn:startEvent>
<bpmn:sequenceFlow id="Flow_043qgd4" sourceRef="StartEvent_1" targetRef="Activity_10k4uq6" />
<bpmn:endEvent id="Event_0dv5rtw">
<bpmn:extensionElements>
<zeebe:ioMapping>
<zeebe:output source="=flatten(waypoints)[item != null]" target="waypoints" />
</zeebe:ioMapping>
</bpmn:extensionElements>
<bpmn:incoming>Flow_0v9ua16</bpmn:incoming>
</bpmn:endEvent>
<bpmn:sequenceFlow id="Flow_0v9ua16" sourceRef="Activity_10k4uq6" targetRef="Event_0dv5rtw" />
<bpmn:serviceTask id="Activity_10k4uq6" name="List waypoints" zeebe:modelerTemplate="com.camunda.SpaceTradersApi" zeebe:modelerTemplateVersion="5" zeebe:modelerTemplateIcon="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAFsElEQVRYR+2WW2wUVRzGf2d2t9vthd6AllZKAVvEUqAFBOItQYKQNEATAlFDgiYC8YFo8IE3UUNIfFAfUKzQGhKUYNHAgwgaCWnjBVEEAq0SoVxaKNKLpbftbnfGnHNmdme3LRaffGCSzVz2zPm+833f/39GtNYutoRhIIT9MwyQ184z+zzis+h7AsuywDKxTBMr4ayej/JM/A8ILHIp4IGElTtKIATC8Gil1BihlZJn5M+KqaBWK++1IlgR9V+iOpgmorV2kRWb1IgRSLBBg2nw6LUiIcHtQ4IouW07XLJLsDgbLJN4AsIF7sqEVkQMA1eKRMG1AupQJDSRuEyMkhHRWiMt0ACJQXOvOia5HOeASwViAmgOjhUOiZgVipSjhB1M0VqzUGUgHswBcUvukIydJZzGFxLW8UGJIcHCYZPm9gjtQ8lM9AeZmimzoK1QSskMtNQ8pjMwgr/D/XbCp4OnHYiXQCrd1h3hxOBUmjJmQUERmBGevXyYxanNdhBjFomWvZKATHi8ClpmTcy5vnPX5PebITrumphARoqHKRN9TMv14zWU+Hx7K4P6ySvw5uVHvSkKCBY0vM+M7N5h/UK07F2gFIgCRonEpG5sGWJ/Qy8XroekcnGHvM1IMXh9dQ5NgRL+LK/CSPKR13OZzqSJhPzpLLHuUHqxmoyAtsbdtETLnvmWU8+JklsIPvt+gLof+zFt4NTUAOHwEIbHIDgw6ASfJyvLCVWuR3g8eAd7WXnqLb4Mzmda1TrmXfyKGZEzMe9dVSJufDxPK2BXgluN/Q1B6k4NxC/ZvvN6PZDkJ2d6Ib2d3Uzf9CKBvFwVrpk/13IxbQ4ir4gNU3x46ncxaVwk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IEC/wB+OnlF9mGuwgAAAABJRU5ErkJggg==">
<bpmn:extensionElements>
<zeebe:taskDefinition type="io.camunda:http-json:1" retries="10" />
<zeebe:ioMapping>
<zeebe:input source="placeholder" target="objects" />
<zeebe:input source="=system" target="objects.getSystemWaypoints_systemSymbol" />
<zeebe:input source="=page" target="objects.getSystemWaypoints_page" />
<zeebe:input source="20" target="objects.getSystemWaypoints_limit" />
<zeebe:input source="=trait" target="objects.getSystemWaypoints_traits" />
<zeebe:input source="=type" target="objects.getSystemWaypoints_type" />
<zeebe:input source="bearer" target="authentication.type" />
<zeebe:input source="= token" target="authentication.token" />
<zeebe:input source="get" target="method" />
<zeebe:input source="="https://api.spacetraders.io/v2/systems/" + string(objects.getSystemWaypoints_systemSymbol) + "/waypoints"" target="url" />
<zeebe:input source="={ "page": objects.getSystemWaypoints_page, "limit": objects.getSystemWaypoints_limit, "traits": objects.getSystemWaypoints_traits, "type": objects.getSystemWaypoints_type }" target="queryParameters" />
</zeebe:ioMapping>
<zeebe:taskHeaders>
<zeebe:header key="category" value="systems" />
<zeebe:header key="operation" value="getSystemWaypoints" />
<zeebe:header key="resultExpression" value="={ "waypoints_page": response.body.data, "meta": response.body.meta }" />
<zeebe:header key="errorExpression" value="=if matches(error.code, "4\d\d") then { error_code: substring after(extract(error.message,"\"code\":\d{4}")[1], ":"), error_message: substring(extract(error.message, "\"message\":\"(\w|\d|\s|\.|\-)+")[1], 12), error_code_by_name: { "4000":"cooldownConflictError", "4001":"waypointNoAccessError", "4100":"tokenEmptyError", "4101":"tokenMissingSubjectError", "4102":"tokenInvalidSubjectError", "4103":"missingTokenRequestError", "4104":"invalidTokenRequestError", "4105":"invalidTokenSubjectError", "4106":"accountNotExistsError", "4107":"agentNotExistsError", "4108":"accountHasNoAgentError", "4109":"registerAgentExistsError", "4110":"registerAgentSymbolReservedError", "4111":"registerAgentConflictSymbolError", "4200":"navigateInTransitError", "4201":"navigateInvalidDestinationError", "4202":"navigateOutsideSystemError", "4203":"navigateInsufficientFuelError", "4204":"navigateSameDestinationError", "4205":"shipExtractInvalidWaypointError", "4206":"shipExtractPermissionError", "4207":"shipJumpNoSystemError", "4208":"shipJumpSameSystemError", "4210":"shipJumpMissingModuleError", "4211":"shipJumpNoValidWaypointError", "4212":"shipJumpMissingAntimatterError", "4214":"shipInTransitError", "4215":"shipMissingSensorArraysError", "4216":"purchaseShipCreditsError", "4217":"shipCargoExceedsLimitError", "4218":"shipCargoMissingError", "4219":"shipCargoUnitCountError", "4220":"shipSurveyVerificationError", "4221":"shipSurveyExpirationError", "4222":"shipSurveyWaypointTypeError", "4223":"shipSurveyOrbitError", "4224":"shipSurveyExhaustedError", "4225":"shipRefuelDockedError", "4226":"shipRefuelInvalidWaypointError", "4227":"shipMissingMountsError", "4228":"shipCargoFullError", "4229":"shipJumpFromGateToGateError", "4230":"waypointChartedError", "4231":"shipTransferShipNotFound", "4232":"shipTransferAgentConflict", "4233":"shipTransferSameShipConflict", "4234":"shipTransferLocationConflict", "4235":"warpInsideSystemError", "4236":"shipNotInOrbitError", "4237":"shipInvalidRefineryGoodError", "4238":"shipInvalidRefineryTypeError", "4239":"shipMissingRefineryError", "4240":"shipMissingSurveyorError", "4241":"shipMissingWarpDriveError", "4242":"shipMissingMineralProcessorError", "4243":"shipMissingMiningLasersError", "4244":"shipNotDockedError", "4245":"purchaseShipNotPresentError", "4246":"shipMountNoShipyardError", "4247":"shipMissingMountError", "4248":"shipMountInsufficientCreditsError", "4249":"shipMissingPowerError", "4250":"shipMissingSlotsError", "4251":"shipMissingMountsError", "4252":"shipMissingCrewError", "4253":"shipExtractDestabilizedError", "4254":"shipJumpInvalidOriginError", "4255":"shipJumpInvalidWaypointError", "4256":"shipJumpOriginUnderConstructionError", "4257":"shipMissingGasProcessorError", "4258":"shipMissingGasSiphonsError", "4259":"shipSiphonInvalidWaypointError", "4260":"shipSiphonPermissionError", "4261":"waypointNoYieldError", "4262":"shipJumpDestinationUnderConstructionError", "4500":"acceptContractNotAuthorizedError", "4501":"acceptContractConflictError", "4502":"fulfillContractDeliveryError", "4503":"contractDeadlineError", "4504":"contractFulfilledError", "4505":"contractNotAcceptedError", "4506":"contractNotAuthorizedError", "4508":"shipDeliverTermsError", "4509":"shipDeliverFulfilledError", "4510":"shipDeliverInvalidLocationError", "4511":"existingContractError", "4600":"marketTradeInsufficientCreditsError", "4601":"marketTradeNoPurchaseError", "4602":"marketTradeNotSoldError", "4603":"marketNotFoundError", "4604":"marketTradeUnitLimitError", "4700":"waypointNoFactionError", "4800":"constructionMaterialNotRequired", "4801":"constructionMaterialFulfilled", "4802":"shipConstructionInvalidLocationError" }, bpmn_error_code: get or else(get value(error_code_by_name, error_code), error_code), error_data: {error_code: error_code, error_message: error_message, error_name: bpmn_error_code}, bpmnError: bpmnError(bpmn_error_code, error_message, error_data) }.bpmnError else null" />
<zeebe:header key="retryBackoff" value="PT1S" />
</zeebe:taskHeaders>
<zeebe:properties>
<zeebe:property name="custom_error_handling" value="by_error_name" />
</zeebe:properties>
</bpmn:extensionElements>
<bpmn:incoming>Flow_043qgd4</bpmn:incoming>
<bpmn:outgoing>Flow_0v9ua16</bpmn:outgoing>
<bpmn:multiInstanceLoopCharacteristics isSequential="true">
<bpmn:extensionElements>
<zeebe:loopCharacteristics inputCollection="=for page in 1..10 return page" inputElement="page" outputCollection="waypoints" outputElement="=waypoints_page" />
</bpmn:extensionElements>
<bpmn:completionCondition xsi:type="bpmn:tFormalExpression">=(meta.page * meta.limit) >= meta.total</bpmn:completionCondition>
</bpmn:multiInstanceLoopCharacteristics>
</bpmn:serviceTask>
<bpmn:textAnnotation id="TextAnnotation_0l5ybqb">
<bpmn:text>Required variables: system, trait, type</bpmn:text>
</bpmn:textAnnotation>
<bpmn:association id="Association_0ssj4an" sourceRef="StartEvent_1" targetRef="TextAnnotation_0l5ybqb" />
</bpmn:process>
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="space-traders-list-waypoints">
<bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1">
<dc:Bounds x="230" y="160" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Event_0dv5rtw_di" bpmnElement="Event_0dv5rtw">
<dc:Bounds x="482" y="160" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_01pa14m_di" bpmnElement="Activity_10k4uq6">
<dc:Bounds x="320" y="138" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="TextAnnotation_0l5ybqb_di" bpmnElement="TextAnnotation_0l5ybqb">
<dc:Bounds x="160" y="70" width="130" height="40" />
<bpmndi:BPMNLabel />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="Flow_043qgd4_di" bpmnElement="Flow_043qgd4">
<di:waypoint x="266" y="178" />
<di:waypoint x="320" y="178" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_0v9ua16_di" bpmnElement="Flow_0v9ua16">
<di:waypoint x="420" y="178" />
<di:waypoint x="482" y="178" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Association_0ssj4an_di" bpmnElement="Association_0ssj4an">
<di:waypoint x="242" y="161" />
<di:waypoint x="222" y="110" />
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</bpmn:definitions>