GetProcessByID() public method

Gets the process by ID.
public GetProcessByID ( System.Int64 AtulProcessID ) : DataTable
AtulProcessID System.Int64 The atul process ID.
return System.Data.DataTable
Ejemplo n.º 1
0
        /// <summary>
        /// Gets the instance detail.
        /// </summary>
        /// <param name="AtulInstanceProcessID">The atul instance process ID.</param>
        /// <returns></returns>
        public string GetInstanceDetail(string AtulInstanceProcessID)
        {
            DataSet dsInstanceDetail = new DataSet("Instance");
            Atul_v1Data adb = new Atul_v1Data();
            DataTable instanceDT = new DataTable("instanceDT");

            DataTable processDT = new DataTable("processDT");
            DataTable subProcessDT = new DataTable("subProcessDT");
            DataTable activityDT = new DataTable("activity");
            DataTable flexfieldDT = new DataTable("flexfield");
            DataTable flexfieldstorageDT = new DataTable("flexfieldstorage");
            //Get The Instance
            instanceDT = adb.GetInstanceProcessByID(Convert.ToInt64(AtulInstanceProcessID));

            //Get The Process
            processDT = adb.GetProcessByID(Convert.ToInt64(instanceDT.Rows[0]["AtulProcessID"].ToString()));

            //Get The Subprocesses
            subProcessDT = adb.GetInstanceSubProcessByID(Convert.ToInt64(AtulInstanceProcessID));

            //Get The SubProcess Activities
            activityDT = adb.GetInstanceProcessActivity(Convert.ToInt64(AtulInstanceProcessID));

            //Get flexfields
            //flexfieldDT = adb.FlexFieldGetByInstanceProcessID(Convert.ToInt64(AtulInstanceProcessID));

            //Get flexfieldstorage
            //flexfieldstorageDT = adb.FlexFieldStorageGetByProcessID(Convert.ToInt64(AtulInstanceProcessID));

            //Make it into one godawful mega dataset
            dsInstanceDetail.Tables.Add(instanceDT);
            dsInstanceDetail.Tables.Add(processDT);
            dsInstanceDetail.Tables.Add(subProcessDT);
            dsInstanceDetail.Tables.Add(activityDT);
            dsInstanceDetail.Tables.Add(flexfieldDT);
            dsInstanceDetail.Tables.Add(flexfieldstorageDT);

            //Convert the whole dataset to XML
            //We do this to avoid the "culture" circular reference and to remove
            //datatypes efficiently
            XmlDocument doc = new XmlDocument();
            doc.LoadXml(dsInstanceDetail.GetXml());
            // Convert XML to a JSON string
            string JSON = JsonMethods.XmlToJSON(doc);

            // Replace \ with \\ because string is being decoded twice
            // JSON = JSON.Replace(@"\", @"\\");
            //this.ProcessCurrentSubProcessActor(Convert.ToInt64(AtulInstanceProcessID));
            return JSON;
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Gets the process by ID.
 /// </summary>
 /// <param name="AtulProcessID">The atul process ID.</param>
 /// <returns></returns>
 public string GetProcessByID(Int64 AtulProcessID)
 {
     DataTable returnTable = new DataTable();
     Atul_v1Data adb = new Atul_v1Data();
     returnTable = adb.GetProcessByID(AtulProcessID);
     return JsonMethods.GetJSONString(returnTable);
 }