Hello Mahmoud,
If I understand your question now, is how to get
active activities (in Aras you can have more that one Active activities) and not the state value of the Workflow?
So lets update the code:
string aml = @"
<AML>
<Item type='Workflow' action='get'>
<source_id>{itemID}</source_id>
<related_id>
<Item type='Workflow Process' action='get'>
<Relationships>
<Item action='get' type='Workflow Process Activity'>
<related_id>
<Item type='Activity'>
<cloned_as condition='is null' />
<state>Active</state>
</Item>
</related_id>
</Item>
</Relationships>
</Item>
</related_id>
</Item>
</AML>";
Item workflowItem = this.getInnovator().applyAML(aml);
if (workflowItem != null && !workflowItem.getItemCount() > 0) {
Item activeActivities = workflowItem.getItemsByXPath("//Item[@type='Activity']");
for (int i = 0; i < activeActivities.getItemCount(); i++) {
Item activeActivity = activeActivities.getItemByIndex(i);
string activeActivityName = activeActivity.getProperty("name", "");
}
}