Example #1
0
        public static ProcessDefination FromJson(JObject data) {
            var entity = new ProcessDefination();
            entity.Id = new Guid(data["Id"].ToString());
            entity.ActivityDefinationId = new Guid(data["ActivityDefinationId"].ToString());
            entity.ActivityId = new Guid(data["ActivityId"].ToString());
            entity.Description = data["Description"].ToString();
            var arr = data["ActivedActivityIds"] as JArray;
            if (arr != null) {
                entity.ActivedActivityIds = new List<Guid>();
                foreach (JToken item in arr) {
                    entity.ActivedActivityIds.Add(new Guid(item.ToString()));
                }
            }
            var extra = data["Extra"] as JObject;
            if (extra != null)
            {
                entity.Extras = new Dictionary<string, string>();
                foreach (var pair in extra)
                {
                    entity.Extras.Add(pair.Key, pair.Value.ToString());
                }
            }

            return entity;
        }
Example #2
0
 public Guid CreateProcess( Guid activityDefinationId, string description)
 {
     var id = Guid.NewGuid();
     var dir = this.RuntimeStorage.CreateItem(id.ToString()) as IStorageDirectory;
     dir.CreateItem("activites");
     var define = new ProcessDefination();
     define.Id = id;
     define.ActivityDefinationId = activityDefinationId;
     define.Description = description;
     var json = define.ToJson();
     dir.PutText("process.json",json);
     return id;
 }
Example #3
0
 public void SaveProcess(ProcessDefination data) {
     var dir = this.RuntimeStorage.GetDirectory(data.Id.ToString(),true) as IStorageDirectory;
     var json = data.ToJson();
     dir.PutText("process.json", json);
 }
Example #4
0
 public Process(ProcessDefination data,Engine engine,IRepository rep=null) {
     this._defination = data;
 }