currentNode = $node;
$this->flowContext = $flowContext;
}
/**
* 1.从流程图中解析出下个节点的Code 更新
*$assigners 数组结构: array(1) { [0]=> array(2) { [0]=> string(2) "F1" [1]=> string(15) "73502-包 博," } }
*/
function doWork()
{
//解析下层节点\WorkFlowParser::getNextLevelNodes
$nextFlowNodes = $this->flowContext->getWorkFLowParser()
->getNextLevelNodes($this->currentNode->getNodeId());
$sm = new SubflowManager(new Flow($this->flowContext->getFormKey()));
foreach (Node::$nodeTypes as $type) {
if (!array_key_exists($type, $nextFlowNodes)) continue;
$seq = 0;
foreach ($nextFlowNodes[$type] as $node) {
if (method_exists($node, 'getAssignerList')) {
$assigners = $node->getAssignerList($this->flowContext->getWorkFLowParser());
$tmp = (array)(explode('-', $assigners[0][1]));
$emp = $tmp[0];
$nextFlowCode = $node->getFlowCode();
$childFlow = new Flow();
$childFlow->setSystemId($this->flowContext->systemId)
->setFlowId($this->flowContext->flowId)
->setFormId($this->flowContext->formId)
->setFlowCode($nextFlowCode)
->insert();
$subflow = new Subflow($childFlow);
$subflow->setCurrentUser($emp)->insert();
$sm->append($subflow, $this->flowContext->getCurrentUser());
echo "会签 " . $seq++ . ":查看下笔链接" . "
";
}
}
}
$nextAssigner = $this->flowContext->getNextAssigner();
$currentFlow = new Flow($this->flowContext->getFormKey());
Subflow::updateCurrentUser($currentFlow->getParentKey(), $nextAssigner);
//exit();
/**
*遍历所有下层节点 ,执行对应Handler类doWork方法
*/
}
}