Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: "Enqueue Item(s)"
linkTitle: "Enqueue Item(s)"
description: "Adds an item or multiple items to a queue."
description: "Add an item or multiple items to a queue."
---
5 changes: 5 additions & 0 deletions content/en/docs/Reference/Blocks/queues/get-count/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: "Get Count(s) of Items"
linkTitle: "Get Count(s) of Items"
description: "Get the count(s) of items in a queue."
---
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
---
title: "Get Count Of All Items"
linkTitle: "Get Count Of All Items"
description: "Gets the count of all items in a Queue."
---

{{< figure src="/blocks/queues-get-count-block-icon.png" alt="Icon" class="block-icon" >}}

# {{% param title %}}

<p class="namespace">(Cortex.Blocks.Queues.GetCount.GetCountOfAllItemsBlock`2)</p>

## Description

Gets the [Count][Count Property] of all items in a [Queue][Queue Property].

## Examples

### Get Count of all items in a Queue

This example will get the count of all items in a [QueueWithPriority][]&lt;[String][], [Int32][]&gt; that contains `"Item -1"` with a priority of `-1` and `"Item 1"` with a priority of `1`.

#### Properties

| Property | Value | Notes |
|--------------------|---------------------------|------------------------------------------|
| [Queue][Queue Property] | `($)Queue`, with value `{"Items": [{"Item": "Item -1", "Priority": -1}, {"Item": "Item 1", "Priority": 1}], "PriorityComparer": {}}` | `($)Queue` is a variable of type [QueueWithPriority][]&lt;[String][], [Int32][]&gt; |
| [Count][Count Property] | `($)Count`, with no value | `($)Count` is a variable that will be set to an [Int32][] value |

#### Result

Getting the count of all items in `{"Items": [{"Item": "Item -1", "Priority": -1}, {"Item": "Item 1", "Priority": 1}], "PriorityComparer": {}}` results in the variable `($)Count` being updated to the following:

```json
2
```

***

## Properties

### Queue

The [Queue][Queue Property] to get the [Count][Count Property] of all items from.

| | |
|--------------------|---------------------------|
| Data Type | [QueueWithPriority][]&lt;[TItem][], [TPriority][]&gt; |
| Property Type | [Input][] |
| Is [Advanced][] | `false` |
| Default Editor | [Variable][] |
| Default Value | `($)Queue` with no value |

### Count

The [Count][Count Property] of all items in [Queue][Queue Property].

| | |
|--------------------|---------------------------|
| Data Type | [Int32][] |
| Property Type | [Output][] |
| Is [Advanced][] | `false` |
| Default Editor | [Variable][] |
| Default Value | `($)Count` with no value |

## Exceptions

The exceptions thrown by the block can be found below:

| Name | Description |
|----------|----------|
| [PropertyNullException][] | Thrown when [Queue][Queue Property] is `null`. |

## Remarks

### Empty List

If [Queue][Queue Property] is empty (i.e. `{"Items": [], "PriorityComparer": {}}`), the variable specified in the [Count][Count Property] property is set to `0`.

[Queue Property]: {{< ref "#queue" >}}
[Count Property]: {{< ref "#count" >}}

[Output]: {{< url "Cortex.Reference.Concepts.Fundamentals.Blocks.BlockProperties.WhatIsABlockProperty.Output" >}}
[Input]: {{< url "Cortex.Reference.Concepts.Fundamentals.Blocks.BlockProperties.WhatIsABlockProperty.Input" >}}

[QueueWithPriority]: {{< url "Cortex.Reference.DataTypes.Collections.QueueWithPriority.MainDoc" >}}

[TItem]: {{< url "Cortex.Reference.Concepts.Fundamentals.DataTypes.Generics.MainDoc" >}}
[TPriority]: {{< url "Cortex.Reference.Concepts.Fundamentals.DataTypes.Generics.MainDoc" >}}

[PropertyNullException]: {{< url "Cortex.Reference.Exceptions.Common.Property.PropertyNullException.MainDoc" >}}

[IList]: {{< url "Cortex.Reference.DataTypes.Collections.IList.MainDoc" >}}
[dynamic]: {{< url "Cortex.Reference.DataTypes.All.dynamic.MainDoc" >}}
[String]: {{< url "Cortex.Reference.DataTypes.Text.String.MainDoc" >}}
[Int32]: {{< url "Cortex.Reference.DataTypes.Numbers.Int32.MainDoc" >}}

[Literal]: {{< url "Cortex.Reference.Concepts.Fundamentals.Blocks.BlockProperties.PropertyEditors.LiteralEditor.MainDoc" >}}
[Variable]: {{< url "Cortex.Reference.Concepts.Fundamentals.Blocks.BlockProperties.PropertyEditors.VariableEditor.MainDoc" >}}
[Expression]: {{< url "Cortex.Reference.Concepts.Fundamentals.Blocks.BlockProperties.PropertyEditors.ExpressionEditor.MainDoc" >}}

[Advanced]: {{< url "Cortex.Reference.Concepts.Fundamentals.Blocks.BlockProperties.AdvancedProperties.MainDoc" >}}
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,10 @@ Currently, only the `<property-name>` has been included in the exception. In fut
* [Convert Object To Text][]
* Queues
* [Enqueue Item][]
* [Enqueue Items][]
* [Get Count Of All Items][Queues Get Count Of All Items]
* [Peek Item][]
* [Remove All Items][Q Remove All Items]
* Text
* [Contains All Text][]
* [Contains Any Text][]
Expand Down Expand Up @@ -338,7 +341,10 @@ None
[Convert Object To Text]: {{< url "Cortex.Reference.Blocks.Objects.ConvertObject.ConvertObjectToText.MainDoc" >}}

[Enqueue Item]: {{< url "Cortex.Reference.Blocks.Queues.EnqueueItem.EnqueueItemBlock.MainDoc" >}}
[Enqueue Items]: {{< url "Cortex.Reference.Blocks.Queues.EnqueueItem.EnqueueItemsBlock.MainDoc" >}}
[Queues Get Count Of All Items]: {{< url "Cortex.Reference.Blocks.Queues.EnqueueItem.GetCountOfAllItemsBlock.MainDoc" >}}
[Peek Item]: {{< url "Cortex.Reference.Blocks.Queues.PeekItem.PeekItemBlock.MainDoc" >}}
[Q Remove All Items]: {{< url "Cortex.Reference.Blocks.Queues.RemoveItem.RemoveAllItemsBlock.MainDoc" >}}

[Contains All Text]: {{< url "Cortex.Reference.Blocks.Text.ContainsText.ContainsAllText.MainDoc" >}}
[Contains Any Text]: {{< url "Cortex.Reference.Blocks.Text.ContainsText.ContainsAnyText.MainDoc" >}}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions data/urls.toml
Original file line number Diff line number Diff line change
Expand Up @@ -693,10 +693,20 @@
MainDoc = "/docs/reference/blocks/queues/enqueue-item/"
[Cortex.Reference.Blocks.Queues.EnqueueItem.EnqueueItemBlock]
MainDoc = "/docs/reference/blocks/queues/enqueue-item/enqueue-item-block-2"
[Cortex.Reference.Blocks.Queues.EnqueueItem.EnqueueItemsBlock]
MainDoc = "/docs/reference/blocks/queues/enqueue-item/enqueue-items-block-2"
[Cortex.Reference.Blocks.Queues.PeekItem]
MainDoc = "/docs/reference/blocks/queues/peek-item/"
[Cortex.Reference.Blocks.Queues.PeekItem.PeekItemBlock]
MainDoc = "/docs/reference/blocks/queues/peek-item/peek-item-block"
[Cortex.Reference.Blocks.Queues.GetCount]
MainDoc = "/docs/reference/blocks/queues/get-count/"
[Cortex.Reference.Blocks.Queues.EnqueueItem.GetCountOfAllItemsBlock]
MainDoc = "/docs/reference/blocks/queues/get-count/get-count-of-all-items-block-2"
[Cortex.Reference.Blocks.Queues.RemoveItem]
MainDoc = "/docs/reference/blocks/queues/remove-item/"
[Cortex.Reference.Blocks.Queues.RemoveItem.RemoveAllItemsBlock]
MainDoc = "/docs/reference/blocks/queues/remove-item/remove-all-items-block"
[Cortex.Reference.Blocks.Ssh]
MainDoc = "/docs/reference/blocks/ssh/"
[Cortex.Reference.Blocks.Ssh.ExecuteSshCommand]
Expand Down