diff --git a/Client-Example/Properties/AssemblyInfo.cs b/Client-Example/Properties/AssemblyInfo.cs index 7834d377..f6f21f37 100644 --- a/Client-Example/Properties/AssemblyInfo.cs +++ b/Client-Example/Properties/AssemblyInfo.cs @@ -27,10 +27,10 @@ [assembly: AssemblyCulture("")] // The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". -// The form "{Major}.{Minor}.*" will automatically update the build and revision, -// and "{Major}.{Minor}.{Build}.*" will update just the revision. +// The form "{Major}.{Minor}./// " will automatically update the build and revision, +// and "{Major}.{Minor}.{Build}./// " will update just the revision. -[assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0./// ")] // The following attributes are used to specify the signing key for the assembly, // if desired. See the Mono documentation for more information about signing. diff --git a/Client-test/CancelWorkflowInstanceTest.cs b/Client-test/CancelWorkflowInstanceTest.cs index 90f2d114..06f3a902 100644 --- a/Client-test/CancelWorkflowInstanceTest.cs +++ b/Client-test/CancelWorkflowInstanceTest.cs @@ -1,6 +1,6 @@ -using System.Threading.Tasks; using GatewayProtocol; using NUnit.Framework; +using System.Threading.Tasks; namespace Zeebe.Client { diff --git a/Client-test/GatewayTestService.cs b/Client-test/GatewayTestService.cs index 8be08b38..9e71d221 100644 --- a/Client-test/GatewayTestService.cs +++ b/Client-test/GatewayTestService.cs @@ -28,11 +28,11 @@ public class GatewayTestService : Gateway.GatewayBase private readonly List<IMessage> requests = new List<IMessage>(); - /** - * Contains the request handler, which return the specific response, for each specific type of request. - * - * Per default the response for a specific type are an empty response. - */ + /// <summary> + /// Contains the request handler, which return the specific response, for each specific type of request. + /// + /// Per default the response for a specific type are an empty response. + /// </summary> private readonly Dictionary<Type, RequestHandler> typedRequestHandler = new Dictionary<Type, RequestHandler>(); public IList<IMessage> Requests => requests; @@ -96,37 +96,37 @@ public override Task<UpdateJobRetriesResponse> UpdateJobRetries(UpdateJobRetries public override Task<DeployWorkflowResponse> DeployWorkflow(DeployWorkflowRequest request, ServerCallContext context) { - return Task.FromResult((DeployWorkflowResponse) HandleRequest(request, context)); + return Task.FromResult((DeployWorkflowResponse)HandleRequest(request, context)); } public override Task<CreateWorkflowInstanceResponse> CreateWorkflowInstance(CreateWorkflowInstanceRequest request, ServerCallContext context) { - return Task.FromResult((CreateWorkflowInstanceResponse) HandleRequest(request, context)); + return Task.FromResult((CreateWorkflowInstanceResponse)HandleRequest(request, context)); } public override Task<CancelWorkflowInstanceResponse> CancelWorkflowInstance(CancelWorkflowInstanceRequest request, ServerCallContext context) { - return Task.FromResult((CancelWorkflowInstanceResponse) HandleRequest(request, context)); + return Task.FromResult((CancelWorkflowInstanceResponse)HandleRequest(request, context)); } public override Task<UpdateWorkflowInstancePayloadResponse> UpdateWorkflowInstancePayload(UpdateWorkflowInstancePayloadRequest request, ServerCallContext context) { - return Task.FromResult((UpdateWorkflowInstancePayloadResponse) HandleRequest(request, context)); + return Task.FromResult((UpdateWorkflowInstancePayloadResponse)HandleRequest(request, context)); } public override Task<ResolveIncidentResponse> ResolveIncident(ResolveIncidentRequest request, ServerCallContext context) { - return Task.FromResult((ResolveIncidentResponse) HandleRequest(request, context)); + return Task.FromResult((ResolveIncidentResponse)HandleRequest(request, context)); } public override Task<ListWorkflowsResponse> ListWorkflows(ListWorkflowsRequest request, ServerCallContext context) { - return Task.FromResult((ListWorkflowsResponse) HandleRequest(request, context)); + return Task.FromResult((ListWorkflowsResponse)HandleRequest(request, context)); } public override Task<GetWorkflowResponse> GetWorkflow(GetWorkflowRequest request, ServerCallContext context) { - return Task.FromResult((GetWorkflowResponse) HandleRequest(request, context)); + return Task.FromResult((GetWorkflowResponse)HandleRequest(request, context)); } private IMessage HandleRequest(IMessage request, ServerCallContext context) diff --git a/Client/Api/Clients/IJobClient.cs b/Client/Api/Clients/IJobClient.cs index 09d2cfd9..eceeee05 100644 --- a/Client/Api/Clients/IJobClient.cs +++ b/Client/Api/Clients/IJobClient.cs @@ -16,53 +16,54 @@ namespace Zeebe.Client.Api.Clients { - /** - * A client with access to all job-related operation: - * <li>complete a job - * <li>mark a job as failed - * <li>update the retries of a job - */ + /// <summary> + /// A client with access to all job-related operation: + /// <li>complete a job + /// <li> mark a job as failed + /// <li> update the retries of a job + /// </summary> public interface IJobClient { - /** - * Command to complete a job. - * - * <pre> - * long jobKey = ..; - * - * jobClient - * .NewCompleteJobCommand(jobKey) - * .Payload(json) - * .Send(); - * </pre> - * - * <p>If the job is linked to a workflow instance then this command will complete the related - * activity and continue the flow. - * - * @param jobKey the key which identifies the job - * @return a builder for the command - */ + /// <summary> + /// Command to complete a job. + /// + /// <pre> + /// long jobKey = ..; + /// + /// jobClient + /// .NewCompleteJobCommand(jobKey) + /// .Payload(json) + /// .Send(); + /// </pre> + /// + /// <p>If the job is linked to a workflow instance then this command will complete the related + /// activity and continue the flow. + /// </p> + /// + /// <param name="jobKey>the key which identifies the job</param> + /// <returns>a builder for the command + ICompleteJobCommandStep1 NewCompleteJobCommand(long jobKey); - /** - * Command to mark a job as failed. - * - * <pre> - * long jobKey = ..; - * - * jobClient - * .NewFailCommand(jobKey) - * .Retries(3) - * .Send(); - * </pre> - * - * <p>If the given retries are greater than zero then this job will be picked up again by a job - * worker. Otherwise, an incident is created for this job. - * - * @param jobKey the key which identifies the job - * @return a builder for the command - */ + /// <summary> + /// Command to mark a job as failed. + /// + /// <pre> + /// long jobKey = ..; + /// + /// jobClient + /// .NewFailCommand(jobKey) + /// .Retries(3) + /// .Send(); + /// </pre> + /// + /// <p>If the given retries are greater than zero then this job will be picked up again by a job + /// worker. Otherwise, an incident is created for this job. + /// </p> + /// <param name="jobKey">the key which identifies the job</param> + /// <returns>a builder for the command + /// </summary> IFailJobCommandStep1 NewFailCommand(long jobKey); } } diff --git a/Client/Api/Commands/ICompleteJobCommandStep1.cs b/Client/Api/Commands/ICompleteJobCommandStep1.cs index 645f5478..a2e7eacf 100644 --- a/Client/Api/Commands/ICompleteJobCommandStep1.cs +++ b/Client/Api/Commands/ICompleteJobCommandStep1.cs @@ -12,20 +12,18 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -using System; using Zeebe.Client.Api.Responses; namespace Zeebe.Client.Api.Commands { public interface ICompleteJobCommandStep1 : IFinalCommandStep<ICompleteJobResponse> { - /** - * Set the payload to complete the job with. - * - * @param payload the payload (JSON) as String - * @return the builder for this command. Call {@link #send()} to complete the command and send it - * to the broker. - */ + /// <summary> + /// Set the payload to complete the job with. + /// </summary> + /// <param name="payload">the payload (JSON) as String</param> + /// <returns>the builder for this command. Call {@link #send()} to complete the command and send it + /// to the broker.</returns> ICompleteJobCommandStep1 Payload(string payload); } } diff --git a/Client/Api/Commands/ICreateWorkflowInstanceCommandStep1.cs b/Client/Api/Commands/ICreateWorkflowInstanceCommandStep1.cs index 7e7cc834..5202c9ae 100644 --- a/Client/Api/Commands/ICreateWorkflowInstanceCommandStep1.cs +++ b/Client/Api/Commands/ICreateWorkflowInstanceCommandStep1.cs @@ -1,66 +1,58 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.IO; -using Zeebe.Client.Api.Commands; +using Zeebe.Client.Api.Commands; using Zeebe.Client.Api.Responses; namespace Zeebe.Client.Api.CommandsClient { public interface ICreateWorkflowInstanceCommandStep1 { - /** - * Set the BPMN process id of the workflow to create an instance of. This is the static id of the - * process in the BPMN XML (i.e. "<bpmn:process id='my-workflow'>"). - * - * @param bpmnProcessId the BPMN process id of the workflow - * @return the builder for this command - */ + /// <summary> + /// Set the BPMN process id of the workflow to create an instance of. This is the static id of the + /// process in the BPMN XML (i.e. "<bpmn:process id='my-workflow'>"). + /// </summary> + /// <param name="bpmnProcessId">the BPMN process id of the workflow</param> + /// <returns>the builder for this command</returns> ICreateWorkflowInstanceCommandStep2 BpmnProcessId(string bpmnProcessId); - /** - * Set the key of the workflow to create an instance of. The key is assigned by the broker while - * deploying the workflow. It can be picked from the deployment or workflow event. - * - * @param workflowKey the key of the workflow - * @return the builder for this command - */ + /// <summary> + /// Set the key of the workflow to create an instance of. The key is assigned by the broker while + /// deploying the workflow. It can be picked from the deployment or workflow event. + /// </summary> + /// <param name="workflowKey">the key of the workflow</param> + /// <returns>the builder for this command</returns> ICreateWorkflowInstanceCommandStep3 WorkflowKey(long workflowKey); } public interface ICreateWorkflowInstanceCommandStep2 { - /** - * Set the version of the workflow to create an instance of. The version is assigned by the - * broker while deploying the workflow. It can be picked from the deployment or workflow event. - * - * @param version the version of the workflow - * @return the builder for this command - */ + /// <summary> + /// Set the version of the workflow to create an instance of. The version is assigned by the + /// broker while deploying the workflow. It can be picked from the deployment or workflow event. + /// </summary> + /// <param name="version">the version of the workflow</param> + /// <returns>the builder for this command</returns> ICreateWorkflowInstanceCommandStep3 Version(int version); - /** - * Use the latest version of the workflow to create an instance of. - * - * <p>If the latest version was deployed few moments before then it can happen that the new - * instance is created of the previous version. - * - * @return the builder for this command - */ + /// <summary> + /// Use the latest version of the workflow to create an instance of. + /// <p> + /// If the latest version was deployed few moments before then it can happen that the new + /// instance is created of the previous version. + /// </p> + /// </summary> + /// <returns>the builder for this command</returns> ICreateWorkflowInstanceCommandStep3 LatestVersion(); } public interface ICreateWorkflowInstanceCommandStep3 : IFinalCommandStep<IWorkflowInstanceResponse> { - /** - * Set the initial payload of the workflow instance. - * - * @param payload the payload (JSON) as String - * @return the builder for this command. Call {@link #send()} to complete the command and send - * it to the broker. - */ + /// <summary> + /// Set the initial payload of the workflow instance. + /// </summary> + /// <param name="payload">the payload (JSON) as String</param> + /// <returns>the builder for this command. Call {@link #send()} to complete the command and send + /// it to the broker.</returns> ICreateWorkflowInstanceCommandStep3 Payload(string payload); } } \ No newline at end of file diff --git a/Client/Api/Commands/IDeployWorkflowCommandStep1.cs b/Client/Api/Commands/IDeployWorkflowCommandStep1.cs index 5bbb978d..fc118118 100644 --- a/Client/Api/Commands/IDeployWorkflowCommandStep1.cs +++ b/Client/Api/Commands/IDeployWorkflowCommandStep1.cs @@ -12,8 +12,6 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -using GatewayProtocol; -using System; using System.IO; using System.Text; using Zeebe.Client.Api.Responses; @@ -22,57 +20,53 @@ namespace Zeebe.Client.Api.Commands { public interface IDeployWorkflowCommandStep1 { - /** - * Add the given resource to the deployment. - * - * @param resourceBytes the workflow resource as byte array - * @param resourceName the name of the resource (e.g. "workflow.bpmn") - * @return the builder for this command. Call {@link #send()} to complete the command and send it - * to the broker. - */ + /// <summary> + /// Add the given resource to the deployment. + /// </summary> + /// <param name="resourceBytes">the workflow resource as byte array</param> + /// <param name="resourceName">the name of the resource (e.g. "workflow.bpmn")</param> + /// <returns>the builder for this command. Call {@link #send()} to complete the command and send it + /// to the broker.</returns> IDeployWorkflowCommandBuilderStep2 AddResourceBytes(byte[] resourceBytes, string resourceName); - /** - * Add the given resource to the deployment. - * - * @param resourceString the workflow resource as String - * @param charset the charset of the String - * @param resourceName the name of the resource (e.g. "workflow.bpmn") - * @return the builder for this command. Call {@link #send()} to complete the command and send it - * to the broker. - */ + /// <summary> + /// Add the given resource to the deployment. + /// </summary> + /// <param name="resourceString">the workflow resource as String</param> + /// <param name="charset">the charset of the String</param> + /// <param name="resourceName">the name of the resource (e.g. "workflow.bpmn")</param> + /// <returns>the builder for this command. Call {@link #send()} to complete the command and send it + /// to the broker.</returns> IDeployWorkflowCommandBuilderStep2 AddResourceString( string resourceString, Encoding encoding, string resourceName); - /** - * Add the given resource to the deployment. - * - * @param resourceString the workflow resource as UTF-8-encoded String - * @param resourceName the name of the resource (e.g. "workflow.bpmn") - * @return the builder for this command. Call {@link #send()} to complete the command and send it - * to the broker. - */ + /// <summary> + /// Add the given resource to the deployment. + /// </summary> + /// <param name="resourceString">the workflow resource as UTF-8-encoded String</param> + /// <param name="resourceName">the name of the resource (e.g. "workflow.bpmn")</param> + /// <returns>the builder for this command. Call {@link #send()} to complete the command and send it + /// to the broker.</returns> IDeployWorkflowCommandBuilderStep2 AddResourceStringUtf8( string resourceString, string resourceName); - /** - * Add the given resource to the deployment. - * - * @param resourceStream the workflow resource as stream - * @param resourceName the name of the resource (e.g. "workflow.bpmn") - * @return the builder for this command. Call {@link #send()} to complete the command and send it - * to the broker. - */ + /// <summary> + /// Add the given resource to the deployment. + /// </summary> + /// <param name="resourceStream">the workflow resource as stream</param> + /// <param name="resourceName">the name of the resource (e.g. "workflow.bpmn")</param> + /// <returns>the builder for this command. Call {@link #send()} to complete the command and send it + /// to the broker. + /// </returns> IDeployWorkflowCommandBuilderStep2 AddResourceStream( Stream resourceStream, string resourceName); - /** - * Add the given resource to the deployment. - * - * @param filename the absolute path of the workflow resource (e.g. "~/wf/workflow.bpmn") - * @return the builder for this command. Call {@link #send()} to complete the command and send it - * to the broker. - */ + /// <summary> + /// Add the given resource to the deployment. + /// </summary> + /// <param name="filename">the absolute path of the workflow resource (e.g. "~/wf/workflow.bpmn")</param> + /// <returns>the builder for this command. Call {@link #send()} to complete the command and send it + /// to the broker.</returns> IDeployWorkflowCommandBuilderStep2 AddResourceFile(string filename); } diff --git a/Client/Api/Commands/IFailJobCommandStep1.cs b/Client/Api/Commands/IFailJobCommandStep1.cs index 0cdfae90..a0b2d00c 100644 --- a/Client/Api/Commands/IFailJobCommandStep1.cs +++ b/Client/Api/Commands/IFailJobCommandStep1.cs @@ -18,31 +18,35 @@ namespace Zeebe.Client.Api.Commands { public interface IFailJobCommandStep1 { - /** - * Set the remaining retries of this job. - * - * <p>If the retries are greater than zero then this job will be picked up again by a job - * worker. Otherwise, an incident is created for this job. - * - * @param remainingRetries the remaining retries of this job (e.g. "jobEvent.getRetries() - 1") - * @return the builder for this command. Call {@link #Send()} to complete the command and send it - * to the broker. - */ + /// <summary> + /// Set the remaining retries of this job. + /// + /// <p>If the retries are greater than zero then this job will be picked up again by a job + /// worker. Otherwise, an incident is created for this job. + /// </p> + /// </summary> + /// + /// <param name="remainingRetries">the remaining retries of this job (e.g. "jobEvent.getRetries() - 1")</param> + /// <returns>the builder for this command. Call {@link #Send()} to complete the command and send it + /// to the broker. + /// </returns> IFailJobCommandStep2 Retries(int remainingRetries); } public interface IFailJobCommandStep2 : IFinalCommandStep<IFailJobResponse> { - /** - * Set the error message of this failing job. - * - * <p>If the retries are zero then this error message will be used for the incident creation. - * - * @param errorMsg the error msg for this failing job - * @return the builder for this command. Call {@link #Send()} to complete the command and send it - * to the broker. - */ + /// <summary> + /// Set the error message of this failing job. + /// + /// <p>If the retries are zero then this error message will be used for the incident creation. + /// + /// </summary> + /// + /// <param name="errorMsg">the error msg for this failing job</param> + /// <returns>the builder for this command. Call {@link #Send()} to complete the command and send it + /// to the broker. + /// </returns> IFailJobCommandStep2 ErrorMessage(string errorMsg); } } \ No newline at end of file diff --git a/Client/Api/Commands/IFinalCommandStep.cs b/Client/Api/Commands/IFinalCommandStep.cs index 378d4aee..c516405e 100644 --- a/Client/Api/Commands/IFinalCommandStep.cs +++ b/Client/Api/Commands/IFinalCommandStep.cs @@ -18,18 +18,19 @@ namespace Zeebe.Client.Api.Commands { public interface IFinalCommandStep<T> { - /** - * Sends the command to the Zeebe broker. This operation is asynchronous. In case of success, the - * future returns the event that was generated by the Zeebe broker in response to the command. - * - * <p>Use `await ...send();` to wait until the response is available. - * - * <pre> - * T response = await command.send(); - * </pre> - * - * @return a task tracking state of success/failure of the command. - */ + /// <summary> + /// Sends the command to the Zeebe broker. This operation is asynchronous. In case of success, the + /// future returns the event that was generated by the Zeebe broker in response to the command. + /// + /// <p>Use `await ...send();` to wait until the response is available. + /// + /// <pre> + /// T response = await command.send(); + /// </pre> + /// + /// </summary> + /// + /// <returns>a task tracking state of success/failure of the command.</returns> Task<T> Send(); } } diff --git a/Client/Api/Commands/IListWorkflowsRequestStep1.cs b/Client/Api/Commands/IListWorkflowsRequestStep1.cs index 88f11ce9..1ca9581a 100644 --- a/Client/Api/Commands/IListWorkflowsRequestStep1.cs +++ b/Client/Api/Commands/IListWorkflowsRequestStep1.cs @@ -2,7 +2,8 @@ namespace Zeebe.Client.Api.Commands { - public interface IListWorkflowsRequestStep1 : IFinalCommandStep<IWorkflowListResponse> { + public interface IListWorkflowsRequestStep1 : IFinalCommandStep<IWorkflowListResponse> + { /// <summary> /// Filter the workflows by the given BPMN process id. /// This is the static id of the process in the diff --git a/Client/Api/Commands/IPublishMessageCommandStep1.cs b/Client/Api/Commands/IPublishMessageCommandStep1.cs index fd9effff..fb27cc5a 100644 --- a/Client/Api/Commands/IPublishMessageCommandStep1.cs +++ b/Client/Api/Commands/IPublishMessageCommandStep1.cs @@ -20,60 +20,58 @@ namespace Zeebe.Client.Api.Commands { public interface IPublishMessageCommandStep1 { - /** - * Set the name of the message. - * - * @param messageName the name of the message - * @return the builder for this command - */ + /// <summary> + /// Set the name of the message. + /// </summary> + /// <param name="messageName"> the name of the message</param> + /// <returns>the builder for this command</returns> IPublishMessageCommandStep2 MessageName(string messageName); } public interface IPublishMessageCommandStep2 { - /** - * Set the correlation-key of the message. - * - * @param correlationKey the correlation-key of the message - * @return the builder for this command - */ + /// <summary> + /// Set the correlation-key of the message. + /// </summary> + /// + /// <param name="correlationKey">the correlation-key of the message</param> + /// <returns>the builder for this command</returns> IPublishMessageCommandStep3 CorrelationKey(string correlationKey); } public interface IPublishMessageCommandStep3 : IFinalCommandStep<IPublishMessageResponse> { - /** - * Set the id of the message. The message is rejected if another message is already published - * with the same id, name and correlation-key. - * - * @param messageId the id of the message - * @return the builder for this command. Call {@link #send()} to complete the command and send - * it to the broker. - */ + /// <summary> + /// Set the id of the message. The message is rejected if another message is already published + /// with the same id, name and correlation-key. + /// </summary> + /// <param name="messageId">the id of the message</param> + /// <returns>the builder for this command. Call {@link #send()} to complete the command and send + /// it to the broker.</returns> IPublishMessageCommandStep3 MessageId(string messageId); - /** - * Set the time-to-live of the message. The message can only be correlated within the given - * time-to-live. - * - * <p>If the duration is zero or negative then the message can only be correlated to open - * subscriptions (e.g. to an entered message catch event). - * - * <p>If no duration is set then the default is used from the configuration. - * - * @param timeToLive the time-to-live of the message - * @return the builder for this command. Call {@link #send()} to complete the command and send - * it to the broker. - */ + /// <summary> + /// Set the time-to-live of the message. The message can only be correlated within the given + /// time-to-live. + /// + /// <p>If the duration is zero or negative then the message can only be correlated to open + /// subscriptions (e.g. to an entered message catch event). + /// + /// <p>If no duration is set then the default is used from the configuration. + /// </summary> + /// + /// <param name="timeToLive">the time-to-live of the message</param> + /// <returns>the builder for this command. Call {@link #send()} to complete the command and send + /// it to the broker.</returns> IPublishMessageCommandStep3 TimeToLive(TimeSpan timeToLive); - /** - * Set the payload of the message. - * - * @param payload the payload (JSON) as String - * @return the builder for this command. Call {@link #send()} to complete the command and send - * it to the broker. - */ + /// <summary> + /// Set the payload of the message. + /// </summary> + /// + /// <param name="payload">the payload (JSON) as String</param> + /// <returns>the builder for this command. Call {@link #send()} to complete the command and send + /// it to the broker.</returns> IPublishMessageCommandStep3 Payload(string payload); } } diff --git a/Client/Api/Commands/IUpdatePayloadCommandStep1.cs b/Client/Api/Commands/IUpdatePayloadCommandStep1.cs index 7474737f..babf9c5d 100644 --- a/Client/Api/Commands/IUpdatePayloadCommandStep1.cs +++ b/Client/Api/Commands/IUpdatePayloadCommandStep1.cs @@ -4,17 +4,18 @@ namespace Zeebe.Client.Api.Commands { public interface IUpdatePayloadCommandStep1 { - /** - * Set the new payload of the element instance. - * - * @param payload the payload (JSON) as String - * @return the builder for this command. Call {@link #Send()} to complete the command and send it - * to the broker. - */ + /// <summary> + /// Set the new payload of the element instance. + /// </summary> + /// + /// <param name="payload">the payload (JSON) as String</param> + /// <returns>the builder for this command. Call {@link #Send()} to complete the command and send it + /// to the broker.</returns> IUpdatePayloadCommandStep2 Payload(string payload); } - public interface IUpdatePayloadCommandStep2 : IFinalCommandStep<IUpdatePayloadResponse> { - // the place for new optional parameters + public interface IUpdatePayloadCommandStep2 : IFinalCommandStep<IUpdatePayloadResponse> + { + // the place for new optional parameters } } \ No newline at end of file diff --git a/Client/Api/Commands/IWorkflowResourceRequestStep1.cs b/Client/Api/Commands/IWorkflowResourceRequestStep1.cs index bc117366..b05e01b2 100644 --- a/Client/Api/Commands/IWorkflowResourceRequestStep1.cs +++ b/Client/Api/Commands/IWorkflowResourceRequestStep1.cs @@ -5,49 +5,51 @@ namespace Zeebe.Client.Api.Commands public interface IWorkflowResourceRequestStep1 { - /** - * Set the BPMN process id of the workflow to create an instance of. This is the static id of the - * process in the BPMN XML (i.e. "<bpmn:process id='my-workflow'>"). - * - * @param bpmnProcessId the BPMN process id of the workflow - * @return the builder for this command - */ + /// <summary> + /// Set the BPMN process id of the workflow to create an instance of. This is the static id of the + /// process in the BPMN XML (i.e. "<bpmn:process id='my-workflow'>"). + /// </summary> + /// + /// <param name="bpmnProcessId">the BPMN process id of the workflow</param> + /// <returns>the builder for this command</returns> IWorkflowResourceRequestStep2 BpmnProcessId(string bpmnProcessId); - /** - * Set the key of the workflow to create an instance of. The key is assigned by the broker while - * deploying the workflow. It can be picked from the deployment or workflow event. - * - * @param workflowKey the key of the workflow - * @return the builder for this command - */ + /// <summary> + /// Set the key of the workflow to create an instance of. The key is assigned by the broker while + /// deploying the workflow. It can be picked from the deployment or workflow event. + /// </summary> + /// + /// <param name="workflowKey">the key of the workflow</param> + /// <returns>the builder for this command</returns> IWorkflowResourceRequestStep3 WorkflowKey(long workflowKey); } public interface IWorkflowResourceRequestStep2 { - /** - * Set the version of the workflow to create an instance of. The version is assigned by the - * broker while deploying the workflow. It can be picked from the deployment or workflow event. - * - * @param version the version of the workflow - * @return the builder for this command - */ + /// <summary> + /// Set the version of the workflow to create an instance of. The version is assigned by the + /// broker while deploying the workflow. It can be picked from the deployment or workflow event. + /// </summary> + /// + /// <param name="version">the version of the workflow</param> + /// <returns>the builder for this command</returns> IWorkflowResourceRequestStep3 Version(int version); - /** - * Use the latest version of the workflow to create an instance of. - * - * <p>If the latest version was deployed few moments before then it can happen that the new - * instance is created of the previous version. - * - * @return the builder for this command - */ + /// <summary> + /// Use the latest version of the workflow to create an instance of. + /// + /// <p>If the latest version was deployed few moments before then it can happen that the new + /// instance is created of the previous version. + /// </p> + /// </summary> + /// + /// <returns>the builder for this command</returns> IWorkflowResourceRequestStep3 LatestVersion(); } - public interface IWorkflowResourceRequestStep3 : IFinalCommandStep<IWorkflowResourceResponse> { - // the place for new optional parameters + public interface IWorkflowResourceRequestStep3 : IFinalCommandStep<IWorkflowResourceResponse> + { + // the place for new optional parameters } } \ No newline at end of file diff --git a/Client/Api/Responses/IBrokerInfo.cs b/Client/Api/Responses/IBrokerInfo.cs index aa0a1c87..5669829d 100644 --- a/Client/Api/Responses/IBrokerInfo.cs +++ b/Client/Api/Responses/IBrokerInfo.cs @@ -18,19 +18,19 @@ namespace Zeebe.Client.Api.Responses { public interface IBrokerInfo { - /** @return the node if of the broker */ + /// <returns>the node if of the broker </returns> int NodeId { get; } - /** @return the address host of the broker */ + /// <returns>the address host of the broker </returns> string Host { get; } - /** @return the address port of the broker */ + /// <returns>the address port of the broker </returns> int Port { get; } - /** @return the address (host+port) of the broker separated by a ':'*/ + /// <returns>the address (host+port) of the broker separated by a ':'</returns> string Address { get; } - /** @return all partitions of the broker */ + /// <returns>all partitions of the broker </returns> IList<IPartitionInfo> Partitions { get; } } } diff --git a/Client/Api/Responses/ICancelWorkflowInstanceResponse.cs b/Client/Api/Responses/ICancelWorkflowInstanceResponse.cs index b0437ff9..d653bf4d 100644 --- a/Client/Api/Responses/ICancelWorkflowInstanceResponse.cs +++ b/Client/Api/Responses/ICancelWorkflowInstanceResponse.cs @@ -1,5 +1,8 @@ namespace Zeebe.Client.Api.Responses { + /// <summary> + /// Response on a cancel workflow instance command. + /// </summary> public interface ICancelWorkflowInstanceResponse { } diff --git a/Client/Api/Responses/ICompleteJobResponse.cs b/Client/Api/Responses/ICompleteJobResponse.cs index 22a2b29e..ba54fe80 100644 --- a/Client/Api/Responses/ICompleteJobResponse.cs +++ b/Client/Api/Responses/ICompleteJobResponse.cs @@ -14,9 +14,9 @@ // limitations under the License. namespace Zeebe.Client.Api.Responses { - /** - * Represents an response for an job complete command request. - */ + /// <summary> + /// Represents an response for an job complete command request. + /// </summary> public interface ICompleteJobResponse { } diff --git a/Client/Api/Responses/IDeployResponse.cs b/Client/Api/Responses/IDeployResponse.cs index 5ac76387..3f97afef 100644 --- a/Client/Api/Responses/IDeployResponse.cs +++ b/Client/Api/Responses/IDeployResponse.cs @@ -4,11 +4,10 @@ namespace Zeebe.Client.Api.Responses { public interface IDeployResponse { - /** @return the unique key of the deployment */ + /// <returns>the unique key of the deployment </returns> long Key { get; } - - - /** @return the workflows meta data, which are deployed */ + + /// <returns>the workflows meta data, which are deployed </returns> IList<IWorkflowMetadata> Workflows { get; } } } \ No newline at end of file diff --git a/Client/Api/Responses/IFailJobResponse.cs b/Client/Api/Responses/IFailJobResponse.cs index d4149af8..75459b4d 100644 --- a/Client/Api/Responses/IFailJobResponse.cs +++ b/Client/Api/Responses/IFailJobResponse.cs @@ -14,9 +14,9 @@ // limitations under the License. namespace Zeebe.Client.Api.Responses { - /** - * Represents an response for an job fail command request. - */ + /// <summary> + /// Represents an response for an job fail command request. + /// </summary> public interface IFailJobResponse { } diff --git a/Client/Api/Responses/IJob.cs b/Client/Api/Responses/IJob.cs index 74d71f3f..4bf30ba8 100644 --- a/Client/Api/Responses/IJob.cs +++ b/Client/Api/Responses/IJob.cs @@ -19,39 +19,39 @@ namespace Zeebe.Client.Api.Responses { public interface IJob { - /** The unique key of the job */ + /// <returns> The unique key of the job </returns> long Key { get; } - /** The type of the job */ + /// <returns> The type of the job </returns> string Type { get; } - /** - * Broker-defined headers associated with this job. For example, if this job is created in - * the context of workflow instance, the header provide context information on which activity - * is executed, etc. - */ + /// <summary> + /// Broker-defined headers associated with this job. For example, if this job is created in + /// the context of workflow instance, the header provide context information on which activity + /// is executed, etc. + /// </summary> IJobHeaders Headers { get; } - /** @return the assigned worker to complete the job */ + /// <returns>the assigned worker to complete the job </returns> string Worker { get; } - /** @return remaining retries */ + /// <returns>remaining retries </returns> int Retries { get; } - /** - * The time until when the job is exclusively assigned to this worker. If the deadline is - * exceeded, it can happen that the job is handed to another worker and the work is performed - * twice. - */ + /// <returns> + /// The time until when the job is exclusively assigned to this worker. If the deadline is + /// exceeded, it can happen that the job is handed to another worker and the work is performed + /// twice. + /// </returns> DateTime Deadline { get; } - /** JSON-formatted payload */ + /// <returns> JSON-formatted payload </returns> string Payload { get; } - /** De-serialized payload as map */ + /// <returns> De-serialized payload as map </returns> IDictionary<string, object> PayloadAsDictionary { get; } - /** @return de-serialized payload as the given type */ + /// <returns>de-serialized payload as the given type </returns> InstanceType PayloadAsType<InstanceType>(); } } \ No newline at end of file diff --git a/Client/Api/Responses/IJobHeaders.cs b/Client/Api/Responses/IJobHeaders.cs index 0c7e91a7..e57267fe 100644 --- a/Client/Api/Responses/IJobHeaders.cs +++ b/Client/Api/Responses/IJobHeaders.cs @@ -14,25 +14,25 @@ // limitations under the License. namespace Zeebe.Client.Api.Responses { - /** Context in case the job is part of a workflow instance */ + /// <returns> Context in case the job is part of a workflow instance </summary> public interface IJobHeaders { - /** Key of the workflow instance */ + /// <returns> Key of the workflow instance </summary> long WorkflowInstanceKey { get; } - /** BPMN process id of the workflow */ + /// <returns> BPMN process id of the workflow </summary> string BpmnProcessId { get; } - /** Version of the workflow */ + /// <returns> Version of the workflow </returns> int WorkflowDefinitionVersion { get; } - /** Key of the workflow */ + /// <returns> Key of the workflow </returns> long WorkflowKey { get; } - /** Id of the workflow element */ + /// <returns> Id of the workflow element </returns> string ElementId { get; } - /** Key of the element instance */ + /// <returns> Key of the element instance </returns> long ElementInstanceKey { get; } } } \ No newline at end of file diff --git a/Client/Api/Responses/IPartitionInfo.cs b/Client/Api/Responses/IPartitionInfo.cs index 49c8a932..29a8745f 100644 --- a/Client/Api/Responses/IPartitionInfo.cs +++ b/Client/Api/Responses/IPartitionInfo.cs @@ -16,13 +16,13 @@ namespace Zeebe.Client.Api.Responses { public interface IPartitionInfo { - /** @return the partition's id */ + /// <returns>the partition's id </returns> int PartitionId { get; } - /** @return the current role of the broker for this partition (i.e. leader or follower) */ + /// <returns>the current role of the broker for this partition (i.e. leader or follower) </returns> PartitionBrokerRole Role { get; } - /** @return <code>true</code> if the broker is the current leader of this partition */ + /// <returns><code>true</code> if the broker is the current leader of this partition </returns> bool IsLeader { get; } } } diff --git a/Client/Api/Responses/IPublishMessageResponse.cs b/Client/Api/Responses/IPublishMessageResponse.cs index a230d513..f6ab308c 100644 --- a/Client/Api/Responses/IPublishMessageResponse.cs +++ b/Client/Api/Responses/IPublishMessageResponse.cs @@ -1,5 +1,8 @@ namespace Zeebe.Client.Api.Responses { + /// <summary> + /// Response for publishing a message. + /// </summary> public interface IPublishMessageResponse { } diff --git a/Client/Api/Responses/IResolveIncidentResponse.cs b/Client/Api/Responses/IResolveIncidentResponse.cs index 8b450e17..7111f7ac 100644 --- a/Client/Api/Responses/IResolveIncidentResponse.cs +++ b/Client/Api/Responses/IResolveIncidentResponse.cs @@ -1,5 +1,8 @@ namespace Zeebe.Client.Api.Responses { + /// <summary> + /// Response for an resolve incident request. + /// </summary> public interface IResolveIncidentResponse { } diff --git a/Client/Api/Responses/ITopology.cs b/Client/Api/Responses/ITopology.cs index 3a618cfa..321b25c8 100644 --- a/Client/Api/Responses/ITopology.cs +++ b/Client/Api/Responses/ITopology.cs @@ -18,7 +18,7 @@ namespace Zeebe.Client.Api.Responses { public interface ITopology { - /** @return all (known) brokers of the cluster */ + /// <returns>all (known) brokers of the cluster </returns> IList<IBrokerInfo> Brokers { get; } } } diff --git a/Client/Api/Responses/IUpdatePayloadResponse.cs b/Client/Api/Responses/IUpdatePayloadResponse.cs index c68644c2..aebe752d 100644 --- a/Client/Api/Responses/IUpdatePayloadResponse.cs +++ b/Client/Api/Responses/IUpdatePayloadResponse.cs @@ -1,7 +1,9 @@ namespace Zeebe.Client.Api.Responses { + /// <summary> + /// Response for an update payload request. + /// </summary> public interface IUpdatePayloadResponse { - } } \ No newline at end of file diff --git a/Client/Api/Responses/IUpdateRetriesResponse.cs b/Client/Api/Responses/IUpdateRetriesResponse.cs index ff3ed8b5..25ec13bc 100644 --- a/Client/Api/Responses/IUpdateRetriesResponse.cs +++ b/Client/Api/Responses/IUpdateRetriesResponse.cs @@ -1,7 +1,9 @@ namespace Zeebe.Client.Api.Responses { + /// <summary> + /// Response for an update retries request. + /// </summary> public interface IUpdateRetriesResponse { - } } \ No newline at end of file diff --git a/Client/Api/Responses/IWorkflowInstanceResponse.cs b/Client/Api/Responses/IWorkflowInstanceResponse.cs index a95a09c0..43cb57f5 100644 --- a/Client/Api/Responses/IWorkflowInstanceResponse.cs +++ b/Client/Api/Responses/IWorkflowInstanceResponse.cs @@ -1,25 +1,28 @@ namespace Zeebe.Client.Api.Responses { + /// <summary> + /// Response for an create workflow instance command. + /// </summary> public interface IWorkflowInstanceResponse { - /// <summary> + /// <returns> /// Key of the workflow which this instance was created for. - /// </summary> + /// </returns> long WorkflowKey { get; } - /// <summary> + /// <returns> /// BPMN process id of the workflow which this instance was created for. - /// </summary> + /// </returns> string BpmnProcessId { get; } - /// <summary> + /// <returns> /// Version of the workflow which this instance was created for. - /// </summary> + /// </returns> int Version { get; } - /// <summary> + /// <returns> /// Unique key of the created workflow instance on the partition. - /// </summary> + /// </returns> long WorkflowInstanceKey { get; } } } \ No newline at end of file diff --git a/Client/Api/Responses/IWorkflowListResponse.cs b/Client/Api/Responses/IWorkflowListResponse.cs index 83afec7b..b931e60b 100644 --- a/Client/Api/Responses/IWorkflowListResponse.cs +++ b/Client/Api/Responses/IWorkflowListResponse.cs @@ -2,8 +2,14 @@ namespace Zeebe.Client.Api.Responses { + /// <summary> + /// Response for an list workflows request. + /// </summary> public interface IWorkflowListResponse { + /// <returns> + /// Returns the requested workflow list. + /// </returns> IList<IWorkflowMetadata> WorkflowList { get; } } } \ No newline at end of file diff --git a/Client/Api/Responses/IWorkflowMetadata.cs b/Client/Api/Responses/IWorkflowMetadata.cs index 1d7dd4a4..147b7847 100644 --- a/Client/Api/Responses/IWorkflowMetadata.cs +++ b/Client/Api/Responses/IWorkflowMetadata.cs @@ -2,16 +2,16 @@ namespace Zeebe.Client.Api.Responses { public interface IWorkflowMetadata { - /** @return the BPMN process id of the workflow */ + /// <returns>the BPMN process id of the workflow </returns> string BpmnProcessId { get; } - /** @return the version of the deployed workflow */ + /// <returns>the version of the deployed workflow </returns> int Version { get; } - /** @return the key of the deployed workflow */ + /// <summary> <returns>the key of the deployed workflow </returns> long WorkflowKey { get; } - /** @return the name of the deployment resource which contains the workflow */ + /// <returns>the name of the deployment resource which contains the workflow </returns> string ResourceName { get; } } } \ No newline at end of file diff --git a/Client/Api/Responses/IWorkflowResourceResponse.cs b/Client/Api/Responses/IWorkflowResourceResponse.cs index a49848d5..0445f71e 100644 --- a/Client/Api/Responses/IWorkflowResourceResponse.cs +++ b/Client/Api/Responses/IWorkflowResourceResponse.cs @@ -1,32 +1,30 @@ -using System.IO; - namespace Zeebe.Client.Api.Responses { public interface IWorkflowResourceResponse { - /// <summary> + /// <returns> /// the BPMN XML resource of the workflow - /// </summary> + /// </returns> string BpmnXml { get; } - /// <summary> + /// <returns> /// the version of the deployed workflow - /// </summary> + /// </returns> int Version { get; } - /// <summary> + /// <returns> /// the bpmn process id - /// </summary> + /// </returns> string BpmnProcessId { get; } - /// <summary> + /// <returns> /// the resource name - /// </summary> + /// </returns> string ResourceName { get; } - /// <summary> + /// <returns> /// the unique workflow key - /// </summary> + /// </returns> long WorkflowKey { get; } } } \ No newline at end of file diff --git a/Client/Api/Responses/PartitionBrokerRole.cs b/Client/Api/Responses/PartitionBrokerRole.cs index 1655d89a..a66373c9 100644 --- a/Client/Api/Responses/PartitionBrokerRole.cs +++ b/Client/Api/Responses/PartitionBrokerRole.cs @@ -14,6 +14,9 @@ // limitations under the License. namespace Zeebe.Client.Api.Responses { + /// <summary> + /// The RAFT role of the broker either LEADER or FOLLOWER. + /// </summary> public enum PartitionBrokerRole { LEADER, diff --git a/Client/Api/Subscription/IJobWorker.cs b/Client/Api/Subscription/IJobWorker.cs index 27baa5e1..5d3cacad 100644 --- a/Client/Api/Subscription/IJobWorker.cs +++ b/Client/Api/Subscription/IJobWorker.cs @@ -16,21 +16,17 @@ namespace Zeebe.Client.Api.Subscription { - /** - * Represents an job worker that performs jobs of a certain type. While a registration is - * open, the worker continuously receives jobs from the broker and hands them to a registered {@link - * JobHandler}. - */ + /// <summary> + /// Represents an job worker that performs jobs of a certain type. While a registration is + /// open, the worker continuously receives jobs from the broker and hands them to a registered {@link + /// JobHandler}. + /// </summary> public interface IJobWorker : IDisposable { - /** - * @return true if this registration is currently active and work items are being received for it - */ + /// <returns>true if this registration is currently active and work items are being received for it</returns> bool IsOpen(); - /** - * @return true if this registration is not open and is not in the process of opening or closing - */ + /// <returns>true if this registration is not open and is not in the process of opening or closing</returns> bool IsClosed(); } } \ No newline at end of file diff --git a/Client/Api/Subscription/IJobWorkerBuilderStep1.cs b/Client/Api/Subscription/IJobWorkerBuilderStep1.cs index ef1e5519..082650f2 100644 --- a/Client/Api/Subscription/IJobWorkerBuilderStep1.cs +++ b/Client/Api/Subscription/IJobWorkerBuilderStep1.cs @@ -20,141 +20,135 @@ namespace Zeebe.Client.Api.Subscription { public interface IJobWorkerBuilderStep1 { - /** - * Set the type of jobs to work on. - * - * @param type the type of jobs (e.g. "payment") - * @return the builder for this worker - */ + /// <summary> + /// Set the type of jobs to work on. + /// </summary> + /// <param name="type">the type of jobs (e.g. "payment")</param> + /// <returns>the builder for this worker</returns> IJobWorkerBuilderStep2 JobType(string type); } + /// <summary> + /// The job handler which contains the business logic. + /// </summary> + /// <param name="client">the job client to complete or fail the job</param> + /// <param name="activatedJob">the job, which was activated by the worker</param> public delegate void JobHandler(IJobClient client, IJob activatedJob); public interface IJobWorkerBuilderStep2 { - /** - * Set the handler to process the jobs. At the end of the processing, the handler should - * complete the job or mark it as failed; - * - * <p>Example JobHandler implementation: - * - * <pre> - * public class PaymentHandler implements JobHandler - * { - * @Override - * public void handle(JobClient client, JobEvent jobEvent) - * { - * String json = jobEvent.getPayload(); - * // modify payload - * - * client - * .CompleteCommand() - * .event(jobEvent) - * .payload(json) - * .send(); - * } - * }; - * </pre> - * - * The handler must be thread-safe. - * - * @param handler the handle to process the jobs - * @return the builder for this worker - */ + /// <summary> + /// Set the handler to process the jobs. At the end of the processing, the handler should + /// complete the job or mark it as failed; + /// + /// <p>Example JobHandler implementation: + /// + /// <pre> + /// var handler = (client, job) => + /// { + /// String json = job.Payload; + /// // modify payload + /// + /// client + /// .CompleteCommand(job.Key) + /// .Payload(json) + /// .Send(); + /// }; + /// </pre> + /// + /// The handler must be thread-safe. + /// </summary> + /// <param name="handler">the handle to process the jobs</param> + /// <returns>the builder for this worker</returns> IJobWorkerBuilderStep3 Handler(JobHandler handler); } public interface IJobWorkerBuilderStep3 { - /** - * Set the time for how long a job is exclusively assigned for this worker. - * - * <p>In this time, the job can not be assigned by other workers to ensure that only one worker - * work on the job. When the time is over then the job can be assigned again by this or other - * worker if it's not completed yet. - * - * <p>If no timeout is set, then the default is used from the configuration. - * - * @param timeout the time in milliseconds - * @return the builder for this worker - */ + /// <summary> + /// Set the time for how long a job is exclusively assigned for this worker. + /// + /// <p>In this time, the job can not be assigned by other workers to ensure that only one worker + /// work on the job. When the time is over then the job can be assigned again by this or other + /// worker if it's not completed yet. + /// + /// <p>If no timeout is set, then the default is used from the configuration. + /// </summary> + /// <param name="timeout">the time in milliseconds</param> + /// <returns>the builder for this worker</returns> IJobWorkerBuilderStep3 Timeout(long timeout); - /** - * Set the time for how long a job is exclusively assigned for this worker. - * - * <p>In this time, the job can not be assigned by other workers to ensure that only one worker - * work on the job. When the time is over then the job can be assigned again by this or other - * worker if it's not completed yet. - * - * <p>If no time is set then the default is used from the configuration. - * - * @param timeout the time as duration (e.g. "Duration.ofMinutes(5)") - * @return the builder for this worker - */ + /// <summary> + /// Set the time for how long a job is exclusively assigned for this worker. + /// + /// <p>In this time, the job can not be assigned by other workers to ensure that only one worker + /// work on the job. When the time is over then the job can be assigned again by this or other + /// worker if it's not completed yet. + /// + /// <p>If no time is set then the default is used from the configuration. + /// + /// <param name="timeout the time as duration (e.g. "Duration.ofMinutes(5)") + /// <returns>the builder for this worker + /// </summary> IJobWorkerBuilderStep3 Timeout(TimeSpan timeout); - /** - * Set the name of the worker owner. - * - * <p>This name is used to identify the worker to which a job is exclusively assigned to. - * - * <p>If no name is set then the default is used from the configuration. - * - * @param workerName the name of the worker (e.g. "payment-service") - * @return the builder for this worker - */ + /// <summary> + /// Set the name of the worker owner. + /// + /// <p>This name is used to identify the worker to which a job is exclusively assigned to. + /// + /// <p> + /// If no name is set then the default is used from the configuration. + /// </p> + /// </summary> + /// <param name="workerName">the name of the worker (e.g. "payment-service")</param> + /// <returns>the builder for this worker</returns> IJobWorkerBuilderStep3 Name(string workerName); - /** - * Set the maximum number of jobs which will be exclusively assigned to this worker at the same - * time. - * - * <p>This is used to control the backpressure of the worker. When the number of assigned jobs - * is reached then the broker will stop assigning new jobs to the worker in order to to not - * overwhelm the client and give other workers the chance to work on the jobs. The broker will - * assign new jobs again when jobs are completed (or marked as failed) which were assigned to - * the worker. - * - * <p>If no limit is set then the default is used from the {@link - * ZeebeClientConfiguration}. - * - * <p>Considerations: - * - * <ul> - * <li>A greater value can avoid situations in which the client waits idle for the broker to - * provide more jobs. This can improve the worker's throughput. - * <li>The memory used by the worker is linear with respect to this value. - * <li>The job's timeout starts to run down as soon as the broker pushes the job. Keep in mind - * that the following must hold to ensure fluent job handling: <code> - * time spent in buffer + time job handler needs until job completion < job timeout</code> - * . - * - * @param numberOfJobs the number of assigned jobs - * @return the builder for this worker - */ + /// <summary> + /// Set the maximum number of jobs which will be exclusively assigned to this worker at the same + /// time. + /// + /// <p>This is used to control the backpressure of the worker. When the number of assigned jobs + /// is reached then the broker will stop assigning new jobs to the worker in order to to not + /// overwhelm the client and give other workers the chance to work on the jobs. The broker will + /// assign new jobs again when jobs are completed (or marked as failed) which were assigned to + /// the worker. + /// + /// <p>If no limit is set then the default is used from the {@link + /// ZeebeClientConfiguration}. + /// + /// <p>Considerations: + /// + /// <ul> + /// <li>A greater value can avoid situations in which the client waits idle for the broker to + /// provide more jobs. This can improve the worker's throughput. + /// <li>The memory used by the worker is linear with respect to this value. + /// <li>The job's timeout starts to run down as soon as the broker pushes the job. Keep in mind + /// that the following must hold to ensure fluent job handling: <code> + /// time spent in buffer + time job handler needs until job completion < job timeout</code> + /// </summary> + /// <param name="numberOfJobs">the number of assigned jobs</param> + /// <returns>the builder for this worker</returns> IJobWorkerBuilderStep3 Limit(int numberOfJobs); - /** - * Set the maximal interval between polling for new jobs. - * - * <p>A job worker will automatically try to always activate new jobs after completing jobs. If - * no jobs can be activated after completing the worker will periodically poll for new jobs. - * - * <p>If no poll interval is set then the default is used from the {@link - * ZeebeClientConfiguration} - * - * @param pollInterval the maximal interval to check for new jobs - * @return the builder for this worker - */ + /// <summary> + /// Set the maximal interval between polling for new jobs. + /// + /// <p>A job worker will automatically try to always activate new jobs after completing jobs. If + /// no jobs can be activated after completing the worker will periodically poll for new jobs. + /// + /// <p>If no poll interval is set then the default is used from the {@link + /// ZeebeClientConfiguration} + /// </summary> + /// <param name="pollInterval">the maximal interval to check for new jobs</param> + /// <returns>the builder for this worker</returns> IJobWorkerBuilderStep3 PollInterval(TimeSpan pollInterval); - /** - * Open the worker and start to work on available tasks. - * - * @return the worker - */ + /// <summary> + /// Open the worker and start to work on available tasks. + /// </summary> + /// <returns>the worker</returns> IJobWorker Open(); } } \ No newline at end of file diff --git a/Client/AssemblyInfo.cs b/Client/AssemblyInfo.cs index 35d67b74..a9ecb1e8 100644 --- a/Client/AssemblyInfo.cs +++ b/Client/AssemblyInfo.cs @@ -1,5 +1,4 @@ -using System.Resources; -// +// // Copyright (c) 2018 camunda services GmbH (info@camunda.com) // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -14,6 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. using System.Reflection; +using System.Resources; // Information about this assembly is defined by the following attributes. // Change them to the values specific to your project. @@ -28,8 +28,8 @@ [assembly: AssemblyCulture("")] // The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". -// The form "{Major}.{Minor}.*" will automatically update the build and revision, -// and "{Major}.{Minor}.{Build}.*" will update just the revision. +// The form "{Major}.{Minor}./// " will automatically update the build and revision, +// and "{Major}.{Minor}.{Build}./// " will update just the revision. [assembly: AssemblyVersion("0.2.0")] [assembly: NeutralResourcesLanguage("en")] diff --git a/Client/IZeebeClient.cs b/Client/IZeebeClient.cs index 1420359f..2dea0934 100644 --- a/Client/IZeebeClient.cs +++ b/Client/IZeebeClient.cs @@ -21,209 +21,206 @@ namespace Zeebe.Client { - /** The client to communicate with a Zeebe broker/cluster. */ + /// <summary> + /// The client to communicate with a Zeebe broker/cluster. + /// </summary> public interface IZeebeClient : IJobClient, IDisposable { - /** - * Registers a new job worker for jobs of a given type. - * - * <p>After registration, the broker activates available jobs and assigns them to this worker. It - * then publishes them to the client. The given worker is called for every received job, works on - * them and eventually completes them. - * - * <pre> - * using(IJobWorker worker = zeebeClient - * .NewWorker() - * .jobType("payment") - * .handler(paymentHandler) - * .open()) - * { - * ... - * } - * </pre> - * - * Example JobHandler implementation: - * - * <pre> - * public class PaymentHandler : IJobHandler - * { - * public override void handle(IJobClient client, JobEvent jobEvent) - * { - * String json = jobEvent.getPayload(); - * // modify payload - * - * client - * .CompleteCommand() - * .event(jobEvent) - * .payload(json) - * .send(); - * } - * }; - * </pre> - * - * @return a builder for the worker registration - */ + /// <summary> + /// Registers a new job worker for jobs of a given type. + /// + /// <p>After registration, the broker activates available jobs and assigns them to this worker. It + /// then publishes them to the client. The given worker is called for every received job, works on + /// them and eventually completes them. + /// + /// <pre> + /// using(IJobWorker worker = zeebeClient + /// .NewWorker() + /// .jobType("payment") + /// .handler(paymentHandler) + /// .open()) + /// { + /// ... + /// } + /// </pre> + /// + /// Example JobHandler implementation: + /// + /// <pre> + /// var handler = (client, job) => + /// { + /// String json = job.Payload; + /// // modify payload + /// + /// client + /// .CompleteCommand(job.Key) + /// .Payload(json) + /// .Send(); + /// }; + /// </pre> + /// + /// The handler must be thread-safe. + /// </summary> + /// + /// <returns>a builder for the worker registration</returns> IJobWorkerBuilderStep1 NewWorker(); - /** - * Command to update the retries of a job. - * - * <pre> - * long jobKey = ..; - * - * zeebeClient - * .newUpdateRetriesCommand(jobKey) - * .retries(3) - * .send(); - * </pre> - * - * <p>If the given retries are greater than zero then this job will be picked up again by a job - * subscription and a related incident will be marked as resolved. - * - * @param jobKey the key of the job to update - * @return a builder for the command - */ - IUpdateRetriesCommandStep1 NewUpdateRetriesCommand(long jobKey); - - /** - * Command to deploy new workflows. - * - * <pre> - * zeebeClient - * .NewDeployCommand() - * .AddResourceFile("~/wf/workflow1.bpmn") - * .AddResourceFile("~/wf/workflow2.bpmn") - * .Send(); - * </pre> - * - * @return a builder for the deploy command - */ + /// <summary> + /// Command to update the retries of a job. + /// + /// <pre> + /// long jobKey = ..; + /// + /// zeebeClient + /// .NewUpdateRetriesCommand(jobKey) + /// .Retries(3) + /// .Send(); + /// </pre> + /// + /// <p>If the given retries are greater than zero then this job will be picked up again by a job + /// subscription and a related incident will be marked as resolved. + /// </summary> + /// <param name="jobKey">the key of the job to update</param> + /// <returns>a builder for the command</returns> + IUpdateRetriesCommandStep1 NewUpdateRetriesCommand(long jobKey); + + /// <summary> + /// Command to deploy new workflows. + /// + /// <pre> + /// zeebeClient + /// .NewDeployCommand() + /// .AddResourceFile("~/wf/workflow1.bpmn") + /// .AddResourceFile("~/wf/workflow2.bpmn") + /// .Send(); + /// </pre> + /// </summary> + /// + /// <returns>a builder for the deploy command</returns> IDeployWorkflowCommandStep1 NewDeployCommand(); - /** - * Command to create/start a new instance of a workflow. - * - * <pre> - * zeebeClient - * .NewCreateInstanceCommand() - * .BpmnProcessId("my-process") - * .LatestVersion() - * .Payload(json) - * .Send(); - * </pre> - * - * @return a builder for the command - */ + /// <summary> + /// Command to create/start a new instance of a workflow. + /// + /// <pre> + /// zeebeClient + /// .NewCreateInstanceCommand() + /// .BpmnProcessId("my-process") + /// .LatestVersion() + /// .Payload(json) + /// .Send(); + /// </pre> + /// + /// </summary> + /// <returns>a builder for the command</returns> ICreateWorkflowInstanceCommandStep1 NewCreateWorkflowInstanceCommand(); - /// <summary> - /// Command to cancel a workflow instance. - /// - /// <pre> - /// zeebeClient - /// .NewCancelInstanceCommand(workflowInstanceKey) - /// .Send(); - /// </pre> - /// </summary> - /// <param name="elementInstanceKey">workflowInstanceKey the key which identifies the corresponding workflow instance </param> - /// <returns> a builder for the command </returns> - /// - ICancelWorkflowInstanceCommandStep1 NewCancelInstanceCommand(long workflowInstanceKey); - - /// <summary> - /// Command to update the payload of a workflow instance. - /// <pre> - /// zeebeClient - /// .NewUpdatePayloadCommand(elementInstanceKey) - /// .Payload(json) - /// .Send(); - /// </pre> - /// </summary> - /// <param name="elementInstanceKey">the key of the element instance to update the payload for</param> - /// <returns> a builder for the command</returns> - IUpdatePayloadCommandStep1 NewUpdatePayloadCommand(long elementInstanceKey); - - - /// <summary> - /// Command to resolve an existing incident. - /// <pre> - /// zeebeClient - /// .NewResolveIncidentCommand(incidentKey) - /// .Send(); - /// </pre> - /// </summary> - /// <param name="incidentKey">incidentKey the key of the corresponding incident</param> - /// <returns>the builder for the command</returns> - IResolveIncidentCommandStep1 NewResolveIncidentCommand(long incidentKey); - - /** - * Command to publish a message which can be correlated to a workflow instance. - * - * <pre> - * zeebeClient - * .newPublishMessageCommand() - * .messageName("order canceled") - * .correlationKey(orderId) - * .payload(json) - * .send(); - * </pre> - * - * @return a builder for the command - */ + /// <summary> + /// Command to cancel a workflow instance. + /// + /// <pre> + /// zeebeClient + /// .NewCancelInstanceCommand(workflowInstanceKey) + /// .Send(); + /// </pre> + /// </summary> + /// <param name="elementInstanceKey">workflowInstanceKey the key which identifies the corresponding workflow instance </param> + /// <returns> a builder for the command </returns> + ICancelWorkflowInstanceCommandStep1 NewCancelInstanceCommand(long workflowInstanceKey); + + /// <summary> + /// Command to update the payload of a workflow instance. + /// <pre> + /// zeebeClient + /// .NewUpdatePayloadCommand(elementInstanceKey) + /// .Payload(json) + /// .Send(); + /// </pre> + /// </summary> + /// <param name="elementInstanceKey">the key of the element instance to update the payload for</param> + /// <returns> a builder for the command</returns> + IUpdatePayloadCommandStep1 NewUpdatePayloadCommand(long elementInstanceKey); + + + /// <summary> + /// Command to resolve an existing incident. + /// <pre> + /// zeebeClient + /// .NewResolveIncidentCommand(incidentKey) + /// .Send(); + /// </pre> + /// </summary> + /// <param name="incidentKey">incidentKey the key of the corresponding incident</param> + /// <returns>the builder for the command</returns> + IResolveIncidentCommandStep1 NewResolveIncidentCommand(long incidentKey); + + /// <summary> + /// Command to publish a message which can be correlated to a workflow instance. + /// + /// <pre> + /// zeebeClient + /// .NewPublishMessageCommand() + /// .MessageName("order canceled") + /// .CorrelationKey(orderId) + /// .Payload(json) + /// .Send(); + /// </pre> + /// + /// </summary> + /// + /// <returns>a builder for the command</returns> IPublishMessageCommandStep1 NewPublishMessageCommand(); - /// <summary> - /// Request to get all deployed workflows. - /// - /// <pre> - /// IList<Workflow> workflows = await zeebeClient - /// .NewWorkflowRequest() - /// .Send() - /// .getWorkflows(); - /// - /// String bpmnProcessId = workflow.getBpmnProcessId(); - /// </pre> - /// - /// The response does not contain the resources of the workflows. Use {@link #newResourceRequest()} - /// to get the resource of a workflow. - /// </summary> - /// @see #newResourceRequest() - /// @return a builder of the request - /// <returns>the builder for the command</returns> - IListWorkflowsRequestStep1 NewListWorkflowRequest(); - - - /// <summary> - /// Request to get the resource of a workflow (i.e. the XML representation). - /// - /// <pre> - /// WorkflowResource resource = workflowClient - /// .newResourceRequest() - /// .bpmnProcessId("my-process") - /// .lastestVersion() - /// .send() - /// .join(); - /// - /// String bpmnXml = resoure.getBpmnXml(); - /// </pre> - /// </summary> - /// <returns>a builder of the request</returns> - IWorkflowResourceRequestStep1 NewWorkflowResourceRequest(); - - /** - * Request the current cluster topology. Can be used to inspect which brokers are available at - * which endpoint and which broker is the leader of which partition. - * - * <pre> - * ITopology response = await ZeebeClient.TopologyRequest().Send(); - * IList<IBrokerInfo> brokers = response.Brokers; - * </pre> - * - * @return the request where you must call {@code send()} - */ + /// <summary> + /// Request to get all deployed workflows. + /// + /// <pre> + /// IList<Workflow> workflows = await zeebeClient + /// .NewListWorkflowRequest() + /// .Send() + /// .getWorkflows(); + /// + /// String bpmnProcessId = workflow.getBpmnProcessId(); + /// </pre> + /// + /// The response does not contain the resources of the workflows. Use {@link #newResourceRequest()} + /// to get the resource of a workflow. + /// </summary> + /// <returns>the builder for the command</returns> + IListWorkflowsRequestStep1 NewListWorkflowRequest(); + + + /// <summary> + /// Request to get the resource of a workflow (i.e. the XML representation). + /// + /// <pre> + /// IWorkflowResourceResponse resource = await zeebeClient + /// .NewWorkflowResourceRequest() + /// .BpmnProcessId("my-process") + /// .LastestVersion() + /// .Send() + /// + /// String bpmnXml = resoure.BpmnXml; + /// </pre> + /// </summary> + /// <returns>a builder of the request</returns> + IWorkflowResourceRequestStep1 NewWorkflowResourceRequest(); + + /// <summary> + /// Request the current cluster topology. Can be used to inspect which brokers are available at + /// which endpoint and which broker is the leader of which partition. + /// + /// <pre> + /// ITopology response = await ZeebeClient.TopologyRequest().Send(); + /// IList<IBrokerInfo> brokers = response.Brokers; + /// </pre> + /// + /// </summary> + /// + /// <returns>the request where you must call #send()</returns> ITopologyRequestStep1 TopologyRequest(); } }