当前位置: 首页>>代码示例>>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;未经允许,请勿转载。