@param $myOrgId
@param CounteragentStatus $counteragentStatus
@param null $afterIndexKey

@return CounteragentList|\Protobuf\Message
765721
public function getCountragents($myOrgId, CounteragentStatus $counteragentStatus = null, $afterIndexKey = null)
    {
        $response = $this->doRequest(
            self::RESOURCE_GET_COUNTERAGENTS,
            [
                'myOrgId'   =>  $myOrgId,
                'counteragentStatus' => $counteragentStatus?$counteragentStatus->name():null,
                'afterIndexKey'  =>  $afterIndexKey
            ]
        );

        return CounteragentList::fromStream($response);
    }
783183
@SuppressWarnings("nls")
    private void indexEntity(String type, String id, XContentBuilder sourceEntity, boolean refresh)
            throws StorageException {
        try {
            String json = sourceEntity.string();
            JestResult response = esClient.execute(new Index.Builder(json).refresh(refresh).index(getIndexName())
                    .setParameter(Parameters.OP_TYPE, "create").type(type).id(id).build());
            if (!response.isSucceeded()) {
                throw new StorageException("Failed to index document " + id + " of type " + type + ": " + response.getErrorMessage());
            }
        } catch (StorageException e) {
            throw e;
        } catch (Exception e) {
            throw new StorageException(e);
        }
    }
583731
function(postmessage) {
			var data = postmessage, action, root, handlers;
			if(gui.Type.isString(data) && data.startsWith("spiritual-action:")) {
				action = gui.Action.parse(data);
				if (action.direction === gui.Action.DESCEND) {
					// Hotfix for actions in nospirit scenario
					// TODO: rething this pending WeakMaps...
					if((handlers = this._globals[action.type])) {
						handlers.slice().forEach(function(handler) {
							handler.onaction(action);
						});
					}
					if(gui.hasModule('gui-spirits@wunderbyte.com')) {
						if ((root = gui.get('html'))) {
							root.action.$handleownaction = true;
							root.action.descendGlobal(
								action.type,
								action.data
							);
						}
					}
				}
			}
		}
1093501
public function __async_add($materialId, $structureId, $afterAction, $afterMaterialId, $afterStructureId)
    {
        /** @var \samson\cms\CMSMaterial $material Current material object */
        $material = null;

        // If there are no such row yet
        if ($this->query->className('\samson\cms\CMSMaterial')->cond('MaterialID', $materialId)->first($material)) {

            /** @var array $structures Array of structures of this material */
            $structureIds = $this->query->className('structurematerial')->cond('MaterialID', $material->id)->fields('StructureID');
            $structures = $this->query->className('structure')->cond('StructureID', $structureIds)->exec();

            // If there are some structures
            if (!empty($structures)) {

                /** @var \samson\cms\Navigation $structure Table structure */
                foreach ($structures as $structure) {

                    // If current material has incoming structure
                    // TODO: Sometimes array has empty values not object - needs to checked
                    if (isset($structure->StructureID) && ($structure->StructureID == $structureId)) {

                        /** @var \samson\social\Core $socialModule Social module object */
                        $socialModule = m('social');
                        /** @var \samson\activerecord\user $user User object */
                        $user = $socialModule->user();

                        // Get max priority of this structure
                        $maxPriority = $this->getMaxPriority($materialId, $structureId);

                        /** @var \samson\cms\CMSMaterial $tableMaterial New table material (table row) */
                        $tableMaterial = new \samson\cms\CMSMaterial(false);
                        $tableMaterial->type = 3;
                        $tableMaterial->Name = $structure->Name;
                        $tableMaterial->Url = $structure->Name . '-' . md5(date('Y-m-d-h-i-s'));
                        $tableMaterial->parent_id = $material->MaterialID;
                        $tableMaterial->Published = 1;
                        $tableMaterial->Active = 1;
                        $tableMaterial->priority = $maxPriority+1;
                        $tableMaterial->UserID = $user->id;
                        $tableMaterial->Created = date('Y-m-d H:m:s');
                        $tableMaterial->Modyfied = $tableMaterial->Created;
                        $tableMaterial->save();

                        /** @var \samson\cms\CMSNavMaterial $structureMaterial Relation between created table material
                         * and table structure */
                        $structureMaterial = new \samson\cms\CMSNavMaterial(false);
                        $structureMaterial->StructureID = $structureId;
                        $structureMaterial->MaterialID  = $tableMaterial->MaterialID;
                        $structureMaterial->Active = 1;
                        $structureMaterial->save();
                    }
                }

                $result = $this->__async_table($afterMaterialId, $afterStructureId);

                Event::fire('samson.cms.web.materialtable.add', array($material->id, $structureId));
                // Set success status and return result
//                return array('status' => 1);
                return $result;
            }
        }
        // Set fail status and return result
        return array('status' => 0);
    }
516992
protected function _afterEntityInsert(AnCommandContext $context)
    {
        $this->parent->getRepository()
                     ->getBehavior('commentable')
                     ->resetStats(array($this->parent));
        $this->parent->execute('after.comment', array('comment' => $this));
    }
1332806
public function afterFind ()
    {
        parent::afterFind();
        $boolArguments = [
            'is_repeating_task',
            'notify_initiator',
            'email_notification',
            'delete_after_run',
        ];
        foreach ($boolArguments as $argument) {
            $this->$argument = boolval($this->$argument);
        }
    }
473056
public function setAfterIndexKey($value = null)
    {
        if ($value !== null && ! $value instanceof \Protobuf\Stream) {
            $value = \Protobuf\Stream::wrap($value);
        }

        $this->AfterIndexKey = $value;
    }
1318370
public function afterMatch($callback = null)
        {
            if ($callback !== null) {
                if (!is_callable($callback)) {
                    throw new InvalidArgumentException(
                        sprintf(
                            "The after match callback provided is not valid. Given (%s)",
                            gettype($callback)
                        )
                    );
                }

                $this->afterMatchCallback = $callback;

                return $this;
            }

            return $this->afterMatchCallback;
        }
61474
public function afterFind()
    {
        parent::afterFind();
        $this->username_is_temporary = boolval($this->username_is_temporary);
        $this->is_active = boolval($this->is_active);
    }
743548
function(postmessage) {
			var b = gui.Broadcast.parse(postmessage);
			if(b.$contextids.indexOf(gui.$contextid) === -1) {
				gui.Broadcast._dispatch(b);
			}
		}
928901
protected function afterFind()
	{
		$this->name_i = $this->title->message;
		$this->desc_i = $this->description->message;
		
		parent::afterFind();
	}
377329
public void afterCompletion(int status)
    {
        if(afterCompletionCall) return;

        log.info("Method afterCompletion was called");
        try
        {
            switch(status)
            {
                case Status.STATUS_COMMITTED:
                    if(log.isDebugEnabled())
                    {
                        log.debug("Method afterCompletion: Do commit internal odmg-tx, status of JTA-tx is " + TxUtil.getStatusString(status));
                    }
                    commit();
                    break;
                default:
                    log.error("Method afterCompletion: Do abort call on internal odmg-tx, status of JTA-tx is " + TxUtil.getStatusString(status));
                    abort();
            }
        }
        finally
        {
            afterCompletionCall = true;
            log.info("Method afterCompletion finished");
        }
    }
1077239
public function setCounteragentStatus(\AgentSIB\Diadoc\Api\Proto\CounteragentStatus $value = null)
    {
        $this->CounteragentStatus = $value;
    }
336368
public static function afterSetupTheme( $callback, $priority = null, $accepted_args = null ) {
		self::action( 'after_setup_theme', $callback, $priority, $accepted_args );
	}
311741
protected function feedback_viewed(\cm_info $cm, $contextid, $userid, $after = null) {
        return $this->feedback_post_action($cm, $contextid, $userid, $this->feedback_viewed_events(), $after);
    }
1138427
public synchronized ServerStatusMessage[] getMessages(ServerStatusMessage afterMessage)
            throws Exception {

        boolean sawAfterMessage;
        String afterMessageString = null;
        if (afterMessage == null) {
            sawAfterMessage = true;
        } else {
            sawAfterMessage = false;
            afterMessageString = afterMessage.toString();
        }

        FileInputStream in = null;
        try {

            in = new FileInputStream(_file);

            BufferedReader reader =
                    new BufferedReader(new InputStreamReader(in));

            List<ServerStatusMessage> messages =
                    new ArrayList<ServerStatusMessage>();
            ServerStatusMessage message = getNextMessage(reader);
            while (message != null) {
                if (!sawAfterMessage) {
                    if (message.toString().equals(afterMessageString)) {
                        sawAfterMessage = true;
                    }
                } else {
                    messages.add(message);
                }
                message = getNextMessage(reader);
            }

            return messages.toArray(STATUS_MSG_ARRAY_TYPE);

        } catch (IOException ioe) {
            throw new Exception("Error opening server status file for reading: "
                                        + _file.getPath(),
                                ioe);
        } finally {
            if (in != null) {
                try {
                    in.close();
                } catch (Exception e) {
                }
            }
        }
    }
1002869
@Override
    public boolean afterUpdate(Object key, Object value, Object currentVersion, Object previousVersion, SoftLock lock) throws CacheException {
        log.debug("region access strategy nonstrict-read-write entity afterUpdate() {} {}", getInternalRegion().getCacheNamespace(), key);
        getInternalRegion().evict(key);
        return false;
    }