Skip to content

Commit

Permalink
Merge pull request #49 from AMalininHere/support-extension-properties
Browse files Browse the repository at this point in the history
Support extension properties
  • Loading branch information
TechnoBerry committed Feb 15, 2022
2 parents 38c3296 + f18d707 commit 1a333c5
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion samples/SampleCamundaWorker/say-hello.bpmn
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
<?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:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" id="Definitions_14z6dpw" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="4.3.0">
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" id="Definitions_14z6dpw" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="4.12.0">
<bpmn:process id="say-hello" name="Say hello" isExecutable="true">
<bpmn:startEvent id="StartEvent_1">
<bpmn:outgoing>SequenceFlow_02ymd8v</bpmn:outgoing>
</bpmn:startEvent>
<bpmn:serviceTask id="Task_0kwyl4k" name="Say hello" camunda:type="external" camunda:topic="sayHello">
<bpmn:extensionElements>
<camunda:properties>
<camunda:property name="Property" value="Value" />
</camunda:properties>
</bpmn:extensionElements>
<bpmn:incoming>SequenceFlow_02ymd8v</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_1fx92lb</bpmn:outgoing>
</bpmn:serviceTask>
Expand Down
3 changes: 2 additions & 1 deletion src/Camunda.Worker/CamundaWorkerBuilderExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ private static HandlerMetadata CollectMetadataFromAttributes(Type handlerType)
return new HandlerMetadata(topicsAttribute.TopicNames, topicsAttribute.LockDuration)
{
LocalVariables = variablesAttribute?.LocalVariables ?? false,
Variables = variablesAttribute?.Variables
Variables = variablesAttribute?.Variables,
IncludeExtensionProperties = topicsAttribute.IncludeExtensionProperties
};
}

Expand Down
2 changes: 2 additions & 0 deletions src/Camunda.Worker/ExternalTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ public ExternalTask(string id, string workerId, string topicName)
/// </summary>
public string? ErrorDetails { get; set; }

public IDictionary<string, string>? ExtensionProperties { get; set; }

public IDictionary<string, Variable>? Variables { get; set; }
}
}
2 changes: 2 additions & 0 deletions src/Camunda.Worker/HandlerTopicsAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,7 @@ public int LockDuration
get => _lockDuration;
set => _lockDuration = Guard.GreaterThanOrEqual(value, Constants.MinimumLockDuration, nameof(LockDuration));
}

public bool IncludeExtensionProperties { get; set; }
}
}

0 comments on commit 1a333c5

Please sign in to comment.