Documentation > CMS Template API Library > Asset > ExecuteWorkflowCommand(Int32,String,Boolean)

ExecuteWorkflowCommand

Execute the specified workflow command on the given asset. The workflow command must be available from the current state of the given asset. ACL for executing workflow commands are respected. Workflow filters for that particular workflow command are respected.

public CrownPeak.CMSAPI.ExecuteWorkflowCommandResponse ExecuteWorkflowCommand(Int32,String,Boolean)


Returns

ExecuteWorkflowCommandResponse.

Parameters

NameDescriptionType
assetId The Id of the asset on which the workflow command should be executed. System.Int32
commandName The name of the workflow command. Not case sensitive. System.String
skipDependencies (Optional) Applies only when workflow results in a publish. If false, dependencies will be computed and published if necessary. Defaults to false. System.Boolean

Code Example

C#

Sample:
// Move the asset to the workflow step that has status set to "LIVE".
ExecuteWorkflowCommandResponse resp = Asset.ExecuteWorkflowCommand(myAssetId, "Deploy to Live");
if (resp.HasError)
{
  Out.WriteLine("ExecuteWorkflowCommand failed: " + resp.ErrorMessage);
}

Connect with Crownpeak