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


PHP CBPActivity類代碼示例

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


在下文中一共展示了CBPActivity類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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 = 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

示例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 = 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

示例4: UnlockWorkflow

 public function UnlockWorkflow(CBPActivity $rootActivity)
 {
     global $DB;
     if ($rootActivity == null) {
         throw new Exception("rootActivity");
     }
     $DB->Query("UPDATE b_bp_instance_state SET " . "\tOWNER_ID = NULL, " . "\tOWNED_UNTIL = NULL " . "WHERE ID = '" . $DB->ForSql($rootActivity->GetWorkflowInstanceId()) . "' " . "\tAND ( " . "\t\t(OWNER_ID = '" . $DB->ForSql($this->serviceInstanceId) . "' " . "\t\t\tAND OWNED_UNTIL >= " . $DB->CurrentTimeFunction() . ") " . "\t\tOR " . "\t\t(OWNER_ID IS NULL) " . "\t\tOR " . "\t\t(OWNER_ID IS NOT NULL " . "\t\t\tAND OWNED_UNTIL < " . $DB->CurrentTimeFunction() . ") " . "\t)");
 }
開發者ID:k-kalashnikov,項目名稱:geekcon.local,代碼行數:8,代碼來源:workflowpersister.php

示例5: OnEvent

 public function OnEvent(CBPActivity $sender, $arEventParameters = array())
 {
     if ($sender == null) {
         throw new Exception("sender");
     }
     $sender->RemoveStatusChangeHandler(self::ClosedEvent, $this);
     if (!$this->TryNextIteration()) {
         $this->workflow->CloseActivity($this);
     }
 }
開發者ID:k-kalashnikov,項目名稱:geekcon_new,代碼行數:10,代碼來源:whileactivity.php

示例6: OnEvent

 public function OnEvent(CBPActivity $sender, $arEventParameters = array())
 {
     $sender->RemoveStatusChangeHandler(self::ClosedEvent, $this);
     $bCloseActivity = false;
     if (is_a($sender, "CBPStateInitializationActivity")) {
         if (strlen($this->nextStateName) > 0) {
             $stateFinalization = null;
             for ($i = 0, $s = sizeof($this->arActivities); $i < $s; $i++) {
                 if (is_a($this->arActivities[$i], "CBPStateFinalizationActivity")) {
                     $stateFinalization = $this->arActivities[$i];
                 }
             }
             if ($stateFinalization != null) {
                 $stateFinalization->AddStatusChangeHandler(self::ClosedEvent, $this);
                 $this->workflow->ExecuteActivity($stateFinalization);
             } else {
                 $bCloseActivity = true;
             }
         } else {
             //$stateService = $this->workflow->GetService("StateService");
             //$stateService->SetStateParameters($this->GetWorkflowInstanceId(), $this->GetAvailableStateEvents());
             $status = $this->ExecuteState();
             if ($status != CBPActivityExecutionStatus::Executing) {
                 $bCloseActivity = true;
             }
         }
     } elseif (is_a($sender, "CBPStateFinalizationActivity")) {
         $bCloseActivity = true;
     } else {
         $stateFinalization = null;
         if (strlen($this->nextStateName) > 0) {
             for ($i = 0, $s = sizeof($this->arActivities); $i < $s; $i++) {
                 if (is_a($this->arActivities[$i], "CBPStateFinalizationActivity")) {
                     $stateFinalization = $this->arActivities[$i];
                 }
             }
         }
         if ($stateFinalization != null) {
             $stateFinalization->AddStatusChangeHandler(self::ClosedEvent, $this);
             $this->workflow->ExecuteActivity($stateFinalization);
         } else {
             $bCloseActivity = true;
         }
     }
     if ($bCloseActivity) {
         $this->arActivityState = array();
         $this->isListenTrigerred = false;
         $arEP = array();
         if (strlen($this->nextStateName) > 0) {
             $arEP["NextStateName"] = $this->nextStateName;
         }
         $this->workflow->CloseActivity($this, $arEP);
     }
 }
開發者ID:Satariall,項目名稱:izurit,代碼行數:54,代碼來源:stateactivity.php

示例7: OnEvent

 public function OnEvent(CBPActivity $sender, $arEventParameters = array())
 {
     $sender->RemoveStatusChangeHandler(self::ClosedEvent, $this);
     if ($this->executionStatus == CBPActivityExecutionStatus::Canceling || $this->executionStatus == CBPActivityExecutionStatus::Faulting) {
         $this->workflow->CloseActivity($this);
     } else {
         if ($this->executionStatus == CBPActivityExecutionStatus::Executing && !$this->TryScheduleNextChild($context)) {
             $this->OnSequenceComplete();
             $this->workflow->CloseActivity($this);
         }
     }
 }
開發者ID:k-kalashnikov,項目名稱:geekcon_new,代碼行數:12,代碼來源:sequenceactivity.php

示例8: OnEvent

 public function OnEvent(CBPActivity $sender, $arEventParameters = array())
 {
     $sender->RemoveStatusChangeHandler(self::ClosedEvent, $this);
     $flag = true;
     for ($i = 0; $i < count($this->arActivities); $i++) {
         $activity = $this->arActivities[$i];
         if ($activity->executionStatus != CBPActivityExecutionStatus::Initialized && $activity->executionStatus != CBPActivityExecutionStatus::Closed) {
             $flag = false;
             break;
         }
     }
     if ($flag) {
         $this->workflow->CloseActivity($this);
     }
 }
開發者ID:k-kalashnikov,項目名稱:geekcon,代碼行數:15,代碼來源:parallelactivity.php

示例9: OnEvent

 public function OnEvent(CBPActivity $sender, $arEventParameters = array())
 {
     $sender->RemoveStatusChangeHandler(self::ClosedEvent, $this);
     if (array_key_exists("NextStateName", $arEventParameters) && strlen($arEventParameters["NextStateName"]) > 0) {
         $nextStateActivity = $this->GetStateActivityByName($arEventParameters["NextStateName"]);
         if ($nextStateActivity == null) {
             throw new Exception("nextStateActivity");
         }
         $nextStateActivity->ReInitialize();
         $nextStateActivity->AddStatusChangeHandler(self::ClosedEvent, $this);
         $this->workflow->ExecuteActivity($nextStateActivity);
     } else {
         $this->workflow->CloseActivity($this);
     }
 }
開發者ID:k-kalashnikov,項目名稱:geekcon_new,代碼行數:15,代碼來源:statemachineworkflowactivity.php

示例10: 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

示例11: ValidateProperties

 public static function ValidateProperties($arTestProperties = array(), CBPWorkflowTemplateUser $user = null)
 {
     $arErrors = array();
     if (strlen($arTestProperties["Text"]) <= 0) {
         $arErrors[] = array("code" => "emptyText", "message" => GetMessage("BPCAL_EMPTY_TEXT"));
     }
     return array_merge($arErrors, parent::ValidateProperties($arTestProperties, $user));
 }
開發者ID:mrdeadmouse,項目名稱:u136006,代碼行數:8,代碼來源:logactivity.php

示例12: ValidateProperties

 public static function ValidateProperties($arTestProperties = array(), CBPWorkflowTemplateUser $user = null)
 {
     $arErrors = array();
     if (strlen($arTestProperties["TargetStateName"]) <= 0) {
         $arErrors[] = array("code" => "emptyState", "parameter" => "TargetStateName", "message" => GetMessage('BPSSA_ERROR_EMPTY_STATE'));
     }
     return array_merge($arErrors, parent::ValidateProperties($arTestProperties, $user));
 }
開發者ID:mrdeadmouse,項目名稱:u136006,代碼行數:8,代碼來源:setstateactivity.php

示例13: ValidateProperties

 public static function ValidateProperties($arTestProperties = array(), CBPWorkflowTemplateUser $user = null)
 {
     $arErrors = array();
     if (!is_array($arTestProperties) || !array_key_exists("VariableValue", $arTestProperties) || !is_array($arTestProperties["VariableValue"]) || count($arTestProperties["VariableValue"]) <= 0) {
         $arErrors[] = array("code" => "NotExist", "parameter" => "VariableValue", "message" => GetMessage("BPSVA_EMPTY_VARS"));
     }
     return array_merge($arErrors, parent::ValidateProperties($arTestProperties, $user));
 }
開發者ID:Satariall,項目名稱:izurit,代碼行數:8,代碼來源:setvariableactivity.php

示例14: ValidateProperties

 public static function ValidateProperties($testProperties = array(), CBPWorkflowTemplateUser $user = null)
 {
     $errors = array();
     try {
         CBPHelper::ParseDocumentId($testProperties['DocumentType']);
     } catch (Exception $e) {
         $errors[] = array("code" => "NotExist", "parameter" => "DocumentType", "message" => GetMessage("BPCLDA_ERROR_DT"));
     }
     return array_merge($errors, parent::ValidateProperties($testProperties, $user));
 }
開發者ID:webgksupport,項目名稱:alpina,代碼行數:10,代碼來源:createlistsdocumentactivity.php

示例15: ValidateProperties

 public static function ValidateProperties($arTestProperties = array(), CBPWorkflowTemplateUser $user = null)
 {
     $arErrors = array();
     /*
     if (strlen($arTestProperties["TargetStateTitle"]) <= 0)
     {
     	$arErrors[] = array("code" => "emptyState", "parameter" => "TargetStateTitle", "message" => "Bad target state.");
     }
     */
     return array_merge($arErrors, parent::ValidateProperties($arTestProperties, $user));
 }
開發者ID:Satariall,項目名稱:izurit,代碼行數:11,代碼來源:setstatetitleactivity.php


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