public virtual void InsertEditorSourceExtraForModel(string modelId, byte[] modelSource)
        {
            IModelEntity model = FindById <IModelEntity>(modelId);

            if (model != null)
            {
                ByteArrayRef @ref = new ByteArrayRef(model.EditorSourceExtraValueId);
                @ref.SetValue("source-extra", modelSource);

                if (model.EditorSourceExtraValueId is null)
                {
                    model.EditorSourceExtraValueId = @ref.Id;
                    UpdateModel(model);
                }
            }
        }
        public virtual void InsertEditorSourceForModel(string modelId, byte[] modelSource)
        {
            IModelEntity model = FindById <IModelEntity>(new KeyValuePair <string, object>("id", modelId));

            if (model != null)
            {
                ByteArrayRef @ref = new ByteArrayRef(model.EditorSourceValueId);
                @ref.SetValue("source", modelSource);

                if (model.EditorSourceValueId is null)
                {
                    model.EditorSourceValueId = @ref.Id;
                    UpdateModel(model);
                }
            }
        }
        public virtual void UpdateInfoJson(string id, byte[] json)
        {
            IProcessDefinitionInfoEntity processDefinitionInfo = FindById <IProcessDefinitionInfoEntity>(id);

            if (processDefinitionInfo != null)
            {
                ByteArrayRef @ref = new ByteArrayRef(processDefinitionInfo.InfoJsonId);
                @ref.SetValue("json", json);

                if (processDefinitionInfo.InfoJsonId is null)
                {
                    processDefinitionInfo.InfoJsonId = @ref.Id;
                    UpdateProcessDefinitionInfo(processDefinitionInfo);
                }
            }
        }