Item workflow = inn.newItem("Workflow","get"); //source_id 表单ID //source_type 对象类ID workflow.setAttribute("select","source_id,source_type"); Item workflow_process = workflow.createRelatedItem("Workflow Process","get");
Workflow是关系类,related_id关联的是Workflow Process的ID。source_id就是表单的ID。
Item wflp_activity = workflow_process.createRelationShip("Workflow Process Activity","get"); wflp_activity.setProperty("related_id",this.getID()); workflow = workflow.apply();
最后就得到了workflow就可以得到表单id以及对象类型id了。下面是上面代码的XMl。可以applyAML();
<Item isNew="1" isTemp="1" type="Workflow" action="get" select="source_id,source_type"> <related_id> <Item isNew="1" isTemp="1" type="Workflow Process" action="get" select="name"> <Relationships> <Item isNew="1" isTemp="1" type="Workflow Process Activity" action="get" select="related_id"> <related_id>F814929E315A48A19512C87A9EE10841</related_id> </Item> </Relationships> </Item> </related_id> </Item>