Ejemplo n.º 1
0
        /// <summary>
        ///  A signal is an event of global scope (broadcast semantics) and is delivered to all active handlers. Internally this maps to the engine&#39;s signal event received builder method &#x60;RuntimeService#createSignalEvent()&#x60;. For more information about the signal behavior, see the [Signal Events](https://docs.camunda.org/manual/7.13/reference/bpmn20/events/signal-events/) section of the [BPMN 2.0 Implementation Reference](https://docs.camunda.org/manual/7.13/reference/bpmn20/).
        /// </summary>
        /// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="signalDto"> (optional)</param>
        /// <returns>Task of ApiResponse</returns>
        public async System.Threading.Tasks.Task <ApiResponse <Object> > ThrowSignalAsyncWithHttpInfo(SignalDto signalDto = default(SignalDto))
        {
            var    localVarPath         = "/signal";
            var    localVarPathParams   = new Dictionary <String, String>();
            var    localVarQueryParams  = new List <KeyValuePair <String, String> >();
            var    localVarHeaderParams = new Dictionary <String, String>(this.Configuration.DefaultHeader);
            var    localVarFormParams   = new Dictionary <String, String>();
            var    localVarFileParams   = new Dictionary <String, FileParameter>();
            Object localVarPostBody     = null;

            // to determine the Content-Type header
            String[] localVarHttpContentTypes = new String[] {
                "application/json"
            };
            String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);

            // to determine the Accept header
            String[] localVarHttpHeaderAccepts = new String[] {
                "application/json"
            };
            String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);

            if (localVarHttpHeaderAccept != null)
            {
                localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
            }

            if (signalDto != null && signalDto.GetType() != typeof(byte[]))
            {
                localVarPostBody = this.Configuration.ApiClient.Serialize(signalDto); // http body (model) parameter
            }
            else
            {
                localVarPostBody = signalDto; // byte array
            }


            // make the HTTP request
            IRestResponse localVarResponse = (IRestResponse)await this.Configuration.ApiClient.CallApiAsync(localVarPath,
                                                                                                            Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
                                                                                                            localVarPathParams, localVarHttpContentType);

            int localVarStatusCode = (int)localVarResponse.StatusCode;

            if (ExceptionFactory != null)
            {
                Exception exception = ExceptionFactory("ThrowSignal", localVarResponse);
                if (exception != null)
                {
                    throw exception;
                }
            }

            return(new ApiResponse <Object>(localVarStatusCode,
                                            localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)),
                                            null));
        }
Ejemplo n.º 2
0
        public int Save(SignalDto signals)
        {
            var result = 0;

            using (var ctx = new SignalsContext())
            {
                ctx.Signals.Add(signals);
                result = ctx.SaveChanges();
            }
            return(result);
        }
Ejemplo n.º 3
0
        public virtual void throwSignal(SignalDto dto)
        {
            string name = dto.Name;

            if (string.ReferenceEquals(name, null))
            {
                throw new InvalidRequestException(Status.BAD_REQUEST, "No signal name given");
            }

            SignalEventReceivedBuilder signalEvent = createSignalEventReceivedBuilder(dto);

            signalEvent.send();
        }
Ejemplo n.º 4
0
        private Types.Signal MapBackDto(SignalDto dto)
        {
            var cSharpPointList =
                dto.Points.Select(p => new Types.Point(p.X, new Types.Complex(p.Y.R, p.Y.I)));
            FSharpList <Types.Point> points = ListModule.OfSeq(cSharpPointList);

            return(new Types.Signal(
                       points,
                       new Types.SignalMetadata(
                           dto.Metadata.SignalType,
                           dto.Metadata.IsContinous,
                           dto.Metadata.Amplitude,
                           dto.Metadata.StartTime,
                           dto.Metadata.Duration,
                           dto.Metadata.DutyCycle,
                           dto.Metadata.SignalFrequency,
                           dto.Metadata.SamplingFrequency
                           )));
        }
Ejemplo n.º 5
0
        /// <summary>
        ///  A signal is an event of global scope (broadcast semantics) and is delivered to all active handlers. Internally this maps to the engine&#39;s signal event received builder method &#x60;RuntimeService#createSignalEvent()&#x60;. For more information about the signal behavior, see the [Signal Events](https://docs.camunda.org/manual/7.14/reference/bpmn20/events/signal-events/) section of the [BPMN 2.0 Implementation Reference](https://docs.camunda.org/manual/7.14/reference/bpmn20/).
        /// </summary>
        /// <exception cref="Camunda.OpenApi.Client.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="signalDto"> (optional)</param>
        /// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
        /// <returns>Task of ApiResponse</returns>
        public async System.Threading.Tasks.Task <Camunda.OpenApi.Client.Client.ApiResponse <Object> > ThrowSignalWithHttpInfoAsync(SignalDto signalDto = default(SignalDto), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
        {
            Camunda.OpenApi.Client.Client.RequestOptions localVarRequestOptions = new Camunda.OpenApi.Client.Client.RequestOptions();

            String[] _contentTypes = new String[] {
                "application/json"
            };

            // to determine the Accept header
            String[] _accepts = new String[] {
                "application/json"
            };


            var localVarContentType = Camunda.OpenApi.Client.Client.ClientUtils.SelectHeaderContentType(_contentTypes);

            if (localVarContentType != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
            }

            var localVarAccept = Camunda.OpenApi.Client.Client.ClientUtils.SelectHeaderAccept(_accepts);

            if (localVarAccept != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
            }

            localVarRequestOptions.Data = signalDto;


            // make the HTTP request

            var localVarResponse = await this.AsynchronousClient.PostAsync <Object>("/signal", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false);

            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("ThrowSignal", localVarResponse);
                if (_exception != null)
                {
                    throw _exception;
                }
            }

            return(localVarResponse);
        }
Ejemplo n.º 6
0
 /// <summary>
 ///  A signal is an event of global scope (broadcast semantics) and is delivered to all active handlers. Internally this maps to the engine&#39;s signal event received builder method &#x60;RuntimeService#createSignalEvent()&#x60;. For more information about the signal behavior, see the [Signal Events](https://docs.camunda.org/manual/7.14/reference/bpmn20/events/signal-events/) section of the [BPMN 2.0 Implementation Reference](https://docs.camunda.org/manual/7.14/reference/bpmn20/).
 /// </summary>
 /// <exception cref="Camunda.OpenApi.Client.Client.ApiException">Thrown when fails to make API call</exception>
 /// <param name="signalDto"> (optional)</param>
 /// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
 /// <returns>Task of void</returns>
 public async System.Threading.Tasks.Task ThrowSignalAsync(SignalDto signalDto = default(SignalDto), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
 {
     await ThrowSignalWithHttpInfoAsync(signalDto, cancellationToken).ConfigureAwait(false);
 }
Ejemplo n.º 7
0
        /// <summary>
        ///  A signal is an event of global scope (broadcast semantics) and is delivered to all active handlers. Internally this maps to the engine&#39;s signal event received builder method &#x60;RuntimeService#createSignalEvent()&#x60;. For more information about the signal behavior, see the [Signal Events](https://docs.camunda.org/manual/7.14/reference/bpmn20/events/signal-events/) section of the [BPMN 2.0 Implementation Reference](https://docs.camunda.org/manual/7.14/reference/bpmn20/).
        /// </summary>
        /// <exception cref="Camunda.OpenApi.Client.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="signalDto"> (optional)</param>
        /// <returns>ApiResponse of Object(void)</returns>
        public Camunda.OpenApi.Client.Client.ApiResponse <Object> ThrowSignalWithHttpInfo(SignalDto signalDto = default(SignalDto))
        {
            Camunda.OpenApi.Client.Client.RequestOptions localVarRequestOptions = new Camunda.OpenApi.Client.Client.RequestOptions();

            String[] _contentTypes = new String[] {
                "application/json"
            };

            // to determine the Accept header
            String[] _accepts = new String[] {
                "application/json"
            };

            var localVarContentType = Camunda.OpenApi.Client.Client.ClientUtils.SelectHeaderContentType(_contentTypes);

            if (localVarContentType != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
            }

            var localVarAccept = Camunda.OpenApi.Client.Client.ClientUtils.SelectHeaderAccept(_accepts);

            if (localVarAccept != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
            }

            localVarRequestOptions.Data = signalDto;


            // make the HTTP request
            var localVarResponse = this.Client.Post <Object>("/signal", localVarRequestOptions, this.Configuration);

            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("ThrowSignal", localVarResponse);
                if (_exception != null)
                {
                    throw _exception;
                }
            }

            return(localVarResponse);
        }
Ejemplo n.º 8
0
 /// <summary>
 ///  A signal is an event of global scope (broadcast semantics) and is delivered to all active handlers. Internally this maps to the engine&#39;s signal event received builder method &#x60;RuntimeService#createSignalEvent()&#x60;. For more information about the signal behavior, see the [Signal Events](https://docs.camunda.org/manual/7.14/reference/bpmn20/events/signal-events/) section of the [BPMN 2.0 Implementation Reference](https://docs.camunda.org/manual/7.14/reference/bpmn20/).
 /// </summary>
 /// <exception cref="Camunda.OpenApi.Client.Client.ApiException">Thrown when fails to make API call</exception>
 /// <param name="signalDto"> (optional)</param>
 /// <returns></returns>
 public void ThrowSignal(SignalDto signalDto = default(SignalDto))
 {
     ThrowSignalWithHttpInfo(signalDto);
 }
Ejemplo n.º 9
0
        protected internal virtual SignalEventReceivedBuilder createSignalEventReceivedBuilder(SignalDto dto)
        {
            RuntimeService             runtimeService = processEngine.RuntimeService;
            string                     name           = dto.Name;
            SignalEventReceivedBuilder signalEvent    = runtimeService.createSignalEvent(name);

            string executionId = dto.ExecutionId;

            if (!string.ReferenceEquals(executionId, null))
            {
                signalEvent.executionId(executionId);
            }

            IDictionary <string, VariableValueDto> variablesDto = dto.Variables;

            if (variablesDto != null)
            {
                IDictionary <string, object> variables = VariableValueDto.toMap(variablesDto, processEngine, objectMapper);
                signalEvent.Variables = variables;
            }

            string tenantId = dto.TenantId;

            if (!string.ReferenceEquals(tenantId, null))
            {
                signalEvent.tenantId(tenantId);
            }

            bool isWithoutTenantId = dto.WithoutTenantId;

            if (isWithoutTenantId)
            {
                signalEvent.withoutTenantId();
            }

            return(signalEvent);
        }
Ejemplo n.º 10
0
 /// <summary>
 ///  A signal is an event of global scope (broadcast semantics) and is delivered to all active handlers. Internally this maps to the engine&#39;s signal event received builder method &#x60;RuntimeService#createSignalEvent()&#x60;. For more information about the signal behavior, see the [Signal Events](https://docs.camunda.org/manual/7.13/reference/bpmn20/events/signal-events/) section of the [BPMN 2.0 Implementation Reference](https://docs.camunda.org/manual/7.13/reference/bpmn20/).
 /// </summary>
 /// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
 /// <param name="signalDto"> (optional)</param>
 /// <returns>Task of void</returns>
 public async System.Threading.Tasks.Task ThrowSignalAsync(SignalDto signalDto = default(SignalDto))
 {
     await ThrowSignalAsyncWithHttpInfo(signalDto);
 }