I have created a sample workflow. In this workflow I have multiple states like Draft, Awaiting approval and Done. Each and every state have a command like submit, approve or reject.
I got my current state from workflow using below code
IWorkflow workflow = workflowProvider.GetWorkflow(args.DataItem[FieldIDs.Workflow]);
var currentWorkflowState = workflow.GetState(args.DataItem);
Now, I want the current command of the state.
but I got all commands from workflow using below code
var currentWorkflowState = workflow.GetCommands(args.DataItem);
Kindly assist, Thanks in advance
var command = workflow.GetCommands(args.DataItem[FieldIDs.WorkflowState]).FirstOrDefault();