當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CBPActivity::GetRootActivity方法代碼示例

本文整理匯總了PHP中CBPActivity::GetRootActivity方法的典型用法代碼示例。如果您正苦於以下問題:PHP CBPActivity::GetRootActivity方法的具體用法?PHP CBPActivity::GetRootActivity怎麽用?PHP CBPActivity::GetRootActivity使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CBPActivity的用法示例。


在下文中一共展示了CBPActivity::GetRootActivity方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: Evaluate

 public function Evaluate(CBPActivity $ownerActivity)
 {
     if ($this->condition == null || !is_array($this->condition) || count($this->condition) <= 0) {
         return true;
     }
     if (!is_array($this->condition[0])) {
         $this->condition = array($this->condition);
     }
     $rootActivity = $ownerActivity->GetRootActivity();
     $result = true;
     foreach ($this->condition as $cond) {
         if ($rootActivity->IsPropertyExists($cond[0])) {
             if (!$this->CheckCondition($rootActivity->{$cond[0]}, $cond[1], $cond[2], $rootActivity->GetPropertyBaseType($cond[0]), $rootActivity)) {
                 $result = false;
                 break;
             }
         } elseif ($rootActivity->IsVariableExists($cond[0])) {
             if (!$this->CheckCondition($rootActivity->GetVariable($cond[0]), $cond[1], $cond[2], $rootActivity->GetVariableBaseType($cond[0]), $rootActivity)) {
                 $result = false;
                 break;
             }
         }
     }
     return $result;
 }
開發者ID:k-kalashnikov,項目名稱:geekcon.local,代碼行數:25,代碼來源:propertyvariablecondition.php

示例2: Evaluate

 public function Evaluate(CBPActivity $ownerActivity)
 {
     if ($this->condition == null || !is_array($this->condition) || count($this->condition) <= 0) {
         return true;
     }
     if (!is_array($this->condition[0])) {
         $this->condition = array($this->condition);
     }
     $rootActivity = $ownerActivity->GetRootActivity();
     $documentId = $rootActivity->GetDocumentId();
     $documentService = $ownerActivity->workflow->GetService("DocumentService");
     $document = $documentService->GetDocument($documentId);
     $documentFields = $documentService->GetDocumentFields($documentService->GetDocumentType($documentId));
     $result = false;
     foreach ($this->condition as $cond) {
         $result = true;
         if (array_key_exists($cond[0], $document)) {
             $fld = isset($document[$cond[0] . "_XML_ID"]) ? $document[$cond[0] . "_XML_ID"] : $document[$cond[0]];
             if (!$this->CheckCondition($fld, $cond[1], $cond[2], $documentFields[$cond[0]]["BaseType"], $rootActivity)) {
                 $result = false;
                 break;
             }
         } else {
             throw new Exception("Field '" . $cond[0] . "' is not found in document (if/else condition)");
             $result = false;
             break;
         }
     }
     return $result;
 }
開發者ID:vim84,項目名稱:b-markt,代碼行數:30,代碼來源:fieldcondition.php

示例3: Evaluate

 public function Evaluate(CBPActivity $ownerActivity)
 {
     if ($this->condition == null || !is_array($this->condition) || count($this->condition) <= 0) {
         return true;
     }
     if (!is_array($this->condition[0])) {
         $this->condition = array($this->condition);
     }
     $rootActivity = $ownerActivity->GetRootActivity();
     $result = array(0 => true);
     $i = 0;
     foreach ($this->condition as $cond) {
         $r = true;
         $joiner = empty($cond[3]) ? static::CONDITION_JOINER_AND : static::CONDITION_JOINER_OR;
         if ($rootActivity->IsPropertyExists($cond[0])) {
             if (!$this->CheckCondition($rootActivity->{$cond[0]}, $cond[1], $cond[2], $rootActivity->GetPropertyBaseType($cond[0]), $rootActivity)) {
                 $r = false;
             }
         } elseif ($rootActivity->IsVariableExists($cond[0])) {
             if (!$this->CheckCondition($rootActivity->GetVariable($cond[0]), $cond[1], $cond[2], $rootActivity->GetVariableBaseType($cond[0]), $rootActivity)) {
                 $r = false;
             }
         }
         if ($joiner == static::CONDITION_JOINER_OR) {
             ++$i;
             $result[$i] = $r;
         } elseif (!$r) {
             $result[$i] = false;
         }
     }
     $result = array_filter($result);
     return sizeof($result) > 0 ? true : false;
 }
開發者ID:Satariall,項目名稱:izurit,代碼行數:33,代碼來源:propertyvariablecondition.php

示例4: Evaluate

 public function Evaluate(CBPActivity $ownerActivity)
 {
     if ($this->condition == null || !is_array($this->condition) || count($this->condition) <= 0) {
         return true;
     }
     if (!is_array($this->condition[0])) {
         $this->condition = array($this->condition);
     }
     $rootActivity = $ownerActivity->GetRootActivity();
     $documentId = $rootActivity->GetDocumentId();
     $documentService = $ownerActivity->workflow->GetService("DocumentService");
     $document = $documentService->GetDocument($documentId);
     $documentFields = $documentService->GetDocumentFields($documentService->GetDocumentType($documentId));
     $result = array(0 => true);
     $i = 0;
     foreach ($this->condition as $cond) {
         $r = true;
         $joiner = empty($cond[3]) ? static::CONDITION_JOINER_AND : static::CONDITION_JOINER_OR;
         if (!isset($document[$cond[0]]) && substr($cond[0], -strlen('_PRINTABLE')) == '_PRINTABLE') {
             $cond[0] = substr($cond[0], 0, strlen($cond[0]) - strlen('_PRINTABLE'));
         }
         if (array_key_exists($cond[0], $document)) {
             $fld = isset($document[$cond[0] . "_XML_ID"]) ? $document[$cond[0] . "_XML_ID"] : $document[$cond[0]];
             if (!$this->CheckCondition($cond[0], $fld, $cond[1], $cond[2], $documentFields[$cond[0]]["BaseType"], $rootActivity)) {
                 $r = false;
             }
         } else {
             throw new Exception("Field '" . $cond[0] . "' is not found in document (if/else condition)");
         }
         if ($joiner == static::CONDITION_JOINER_OR) {
             ++$i;
             $result[$i] = $r;
         } elseif (!$r) {
             $result[$i] = false;
         }
     }
     $result = array_filter($result);
     return sizeof($result) > 0 ? true : false;
 }
開發者ID:webgksupport,項目名稱:alpina,代碼行數:39,代碼來源:fieldcondition.php

示例5: Evaluate

 public function Evaluate(CBPActivity $ownerActivity)
 {
     if ($this->condition == null || !is_array($this->condition) || count($this->condition) <= 0) {
         return true;
     }
     if (!is_array($this->condition[0])) {
         $this->condition = array($this->condition);
     }
     $rootActivity = $ownerActivity->GetRootActivity();
     $documentId = $rootActivity->GetDocumentId();
     $documentService = $ownerActivity->workflow->GetService("DocumentService");
     $document = $documentService->GetDocument($documentId);
     $documentFields = $documentService->GetDocumentFields($documentService->GetDocumentType($documentId));
     $result = true;
     foreach ($this->condition as $cond) {
         if (array_key_exists($cond[0], $document)) {
             if (!$this->CheckCondition($document[$cond[0]], $cond[1], $cond[2], $documentFields[$cond[0]]["BaseType"], $rootActivity)) {
                 $result = false;
                 break;
             }
         }
     }
     return $result;
 }
開發者ID:k-kalashnikov,項目名稱:geekcon_new,代碼行數:24,代碼來源:fieldcondition.php


注:本文中的CBPActivity::GetRootActivity方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。