Campaigns
Campaigns provide the ability to perform a single operation on multiple things simultaneously.
Campaigns are a single-use action. Some examples for using campaigns are the following:
-
adding and deleting tags
-
executing methods defined in a thing definition
You can clone an existing campaign.
Once a campaign is created and things are added to the campaign, the campaign must be started or scheduled to start at a future time. When the campaign starts, the campaign task is executed on each campaign member.
The campaign and the campaign members each have a status value. The campaign has a Ready to start, Scheduled, Running, and Finished value to indicate the overall state of the campaign. The campaign also has values to indicate the number of campaign members in the ready, inProgress, success, and failed state.
The state of a campaign member is represented as an integer value with the following possible values:
Value |
State |
---|---|
1 |
ready |
2 |
inProgress |
3 |
success |
4 |
failure |
Executions that end in a failed state show an error code and error message.
Once the campaign starts, the campaign is not finished until each campaign member completes the task. For a list of the campaign member states, click the View icon of the finished campaign. Any campaign tasks that require parameters are provided as an array of parameters, depending on the task specified in the campaign)
You cannot delete a campaign that is in progress.