本文整理汇总了C#中CodeActivityContext.SetValue方法的典型用法代码示例。如果您正苦于以下问题:C# CodeActivityContext.SetValue方法的具体用法?C# CodeActivityContext.SetValue怎么用?C# CodeActivityContext.SetValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CodeActivityContext
的用法示例。
在下文中一共展示了CodeActivityContext.SetValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Execute
protected override void Execute(CodeActivityContext context)
{
DynamicValue taskdata = context.GetValue(this.Data);
DynamicValue MessageId = new DynamicValue();
taskdata.TryGetValue("MessageId", out MessageId);
IMessageStore messageStore = strICT.InFlow.Db.StoreHandler.getMessageStore(context.GetValue(cfgSQLConnectionString));
M_Message message = messageStore.getMessageBymsgId(Convert.ToInt32(MessageId.ToString()));
//store message-type in GlobalTransition
context.SetValue(GlobalTransition, message.Sender_SubjectName + "|" + message.Message_Type);
DynamicValue data = DynamicValue.Parse(message.Data);
DynamicValue variables = context.GetValue(GlobalVariables);
//write message data to GlobalVariables
foreach (string i in data.Keys)
{
DynamicValue value = new DynamicValue();
data.TryGetValue(i, out value);
if (variables.ContainsKey(i))
{
variables.Remove(i);
}
variables.Add(i, value);
}
context.SetValue(GlobalVariables, variables);
//mark message in message-store as received
messageStore.markMessageAsReceived(message.Id);
}
示例2: ReadAppConfig
/// <summary>
/// 读取配置文件中以上配置节的值
/// </summary>
private void ReadAppConfig(CodeActivityContext context)
{
//为三个输出变量赋值
context.SetValue(SleepTime, int.Parse(ConfigHelper.GetSettingValue("sleepTime")));
var key = ConfigHelper.GetSettingValue("list_id");
context.SetValue(Id_list, key);
context.SetValue(Seconds_Interval, double.Parse(ConfigHelper.GetSettingValue("seconds_add")));
//context.SetValue<string>(temp, "123");
}
示例3: Execute
// 如果活动返回值,则从 CodeActivity<TResult>
// 并从 Execute 方法返回该值。
//qu
protected override void Execute(CodeActivityContext context)
{
// 获取 Text 输入参数的运行时值
string text = context.GetValue(this.Text);
var state = context.GetValue(this.Match_Enum);
List<SMSModel_QueryReceive> list = context.GetValue(List_QueryReceive);
SMSModel_QueryReceive item = context.GetValue(Item);
// int state = -1;
//将拥有符合条件的msgid的item存入list
InsertListModel(item, ref list, ref state);
context.SetValue(Match_Enum, state);
context.SetValue(List_QueryReceive, list);
}
示例4: Execute
// If your activity returns a value, derive from CodeActivity<TResult>
// and return the value from the Execute method.
protected override void Execute(CodeActivityContext context)
{
// Obtain the runtime value of the Text input argument
string text = context.GetValue(Text);
context.SetValue(Output, $"{text} workflow");
}
示例5: Execute
// If your activity returns a value, derive from CodeActivity<TResult>
// and return the value from the Execute method.
protected override void Execute(CodeActivityContext context)
{
// Obtain the runtime value of the Text input argument
string text = context.GetValue(this.Text);
context.SetValue(UserClickedButton, System.Windows.MessageBox.Show(
text, "FIB->FIS Handover", System.Windows.MessageBoxButton.YesNo));
}
示例6: Execute
protected override void Execute(CodeActivityContext context)
{
CoreFunctions core = new CoreFunctions(context.GetValue(cfgWFMBaseAddress), context.GetValue(cfgWFMUsername), context.GetValue(cfgWFMPassword), context.GetValue(cfgSQLConnectionString));
string id = core.startNewSubjectProcess(context.GetValue(ProcessInstanceId), context.GetValue(ProcessSubjectId), context.GetValue(Owner));
context.SetValue(NewProcessId, id);
}
示例7: Execute
protected override void Execute(CodeActivityContext context)
{
var isValid = new bool?();
var loan = context.GetValue(this.Loan);
if (!(loan.CreditRating > 0))
{
isValid = false;
}
if (!(loan.DownPaymentAmount > 0))
{
isValid = false;
}
if (!(loan.LoanAmount > 0))
{
isValid = false;
}
//If we didn't get set to false then we're valid.
if(!isValid.HasValue)
{
isValid = true;
}
context.SetValue(Valid, isValid);
}
示例8: Execute
// If your activity returns a value, derive from CodeActivity<TResult>
// and return the value from the Execute method.
protected override void Execute(CodeActivityContext context)
{
// Obtain the runtime value of the Text input argument
ItemInfo i = new ItemInfo();
i.ItemCode = context.GetValue<string>(this.ItemCode);
switch (i.ItemCode)
{
case "12345":
i.Description = "Widget";
i.Price = (decimal)10.0;
break;
case "12346":
i.Description = "Gadget";
i.Price = (decimal)15.0;
break;
case "12347":
i.Description = "Super Gadget";
i.Price = (decimal)25.0;
break;
}
context.SetValue(this.Item, i);
}
示例9: Execute
// 如果活动返回值,则从 CodeActivity<TResult>
// 派生并从 Execute 方法返回该值。
protected override void Execute(CodeActivityContext context)
{
var sourceimage = 原图.Get(context);
var sim = 相似度下限.Get(context);
var width = 查找区域宽度.Get(context);
var height = 查找区域高度.Get(context);
var etm = new ExhaustiveTemplateMatching(sim==null?0.9f:sim.Value);
var match = etm.ProcessImage(sourceimage, context.GetValue(匹配图), new Rectangle(查找区域左偏移量.Get(context), 查找区域上偏移量.Get(context), width == null ? sourceimage.Width : width.Value, height == null ? sourceimage.Height : height.Value));
context.SetValue(匹配项, match);
if (match != null && match.Length > 0)
{
var bestmatch = match.OrderByDescending(q => q.Similarity).First();
context.SetValue(最佳匹配项, bestmatch);
var bestmatchpos = bestmatch.Rectangle.Location;
context.SetValue(最佳匹配项坐标位置, bestmatchpos);
}
}
示例10: Execute
protected override void Execute(CodeActivityContext context)
{
// Obtain the runtime value of the Text input argument
Expense expense = context.GetValue(this.Expense);
ExpenseReview review = context.GetValue(this.ExpenseReview);
ExpenseComponent bc = new ExpenseComponent();
if (review.IsApproved)
{
context.SetValue(this.Expense, bc.Disburse(expense, review));
}
else
{
context.SetValue(this.Expense, bc.Reject(expense, review));
}
}
示例11: Execute
protected override void Execute(CodeActivityContext context)
{
var provider = ServiceLocator.Current.GetInstance<IFlowExtensionProvider>();
var output = provider.NeedConfirmation();
context.SetValue(IsSkip, !output);
}
示例12: Execute
// If your activity returns a value, derive from CodeActivity<TResult>
// and return the value from the Execute method.
protected override void Execute(CodeActivityContext context)
{
var wfcontext = context.GetValue(this.WFContext);
wfcontext.ViewName = "CreditCard";
wfcontext.ViewData.Model = new CreditCardInfo();
context.SetValue(WFContext, wfcontext);
}
示例13: Execute
protected override void Execute(CodeActivityContext context)
{
// Obtain the runtime value of the Text input argument
Expense expense = context.GetValue(this.Expense);
//expense.WorkflowID = Guid.NewGuid();
ExpenseComponent bc = new ExpenseComponent();
context.SetValue(this.Expense, bc.Submit(expense));
}
示例14: Execute
// If your activity returns a value, derive from CodeActivity<TResult>
// and return the value from the Execute method.
protected override void Execute(CodeActivityContext context)
{
var wfcontext = context.GetValue(this.WFContext);
wfcontext.ViewName = "BillingAddress";
wfcontext.ViewData.Model = new Order();
context.SetValue(WFContext, wfcontext);
}
示例15: Execute
protected override void Execute(CodeActivityContext context)
{
// Obtain the runtime value of the Text input argument
Expense expense = context.GetValue(this.Expense);
//expense.WorkflowID = this.WorkflowInstanceId;
ExpenseComponent bc = new ExpenseComponent();
context.SetValue(this.Expense, bc.Escalate(expense));
}