public void CreateTravelObject(Process p, string num)
        {
            using (SourceCode.Field.Core.Helper.K2Helper helper = new K2Helper("dlx"))
            {
                Dictionary<string, object> Data = new Dictionary<string, object>();
                Data.Add("PersonName", "Adam Castle");
                Data.Add("Amount", num);
                string TravelRequestsID = helper.SmartObjectClient().SmartObjectCreate(Data, "TravelRequestsID", "TravelRequests");

                //Lets create a new data field, so when our process starts it will start with the new travel request ID
                CoreDataField df = new CoreDataField();
                df.Name = "TravelRequestsID";
                df.Value = TravelRequestsID;

                p.Activities[0].DataFields.Add(df.Name,df);
            }
        }
        public void prepareDataFieldsTest()
        {
            TestingHelper_Accessor target = new TestingHelper_Accessor(); // TODO: Initialize to an appropriate value
            Dictionary<string, CoreDataField> dataFields = new Dictionary<string, CoreDataField>();
            CoreDataField dataField = new CoreDataField();
            target.currentProcess = new Process();
            target.currentActivity = new Activity();
            string keyToSet = "blah";
            string assertValue = "AssertBlah";

            dataField.Name = keyToSet;
            dataField.Check = "setToVariable";
            dataField.Value = keyToSet;
            dataFields.Add(keyToSet, dataField);
            target.dataFieldDictionary[keyToSet] = assertValue;
            target.prepareDataFields(dataFields);
            Assert.AreEqual(dataFields[keyToSet].Value.ToString(), assertValue);
        }
Пример #3
0
 public static CoreDataField ConvertWFDataFieldToCoreDataField(DataField df)
 {
     CoreDataField retVal = new CoreDataField();
     retVal.Name = df.Name;
     retVal.Value = df.Value;
     return retVal;
 }