Beispiel #1
0
        protected override void Execute(NativeActivityContext context)
        {
            try
            {
                dtable = DataTableObject.Get(context);
                string lstResult = string.Empty;
                rowcount = 0;
                //  activitycount = Activities.Count - 1;
                activitycount = 0;
                DataRow dataRow = dtable.Rows[rowcount];
                CurrentDataRow.Set(context, dataRow);

                lstResult = Convert.ToString(dataRow[ColumnNumber]);
                ListResult.Set(context, lstResult);
                var itemInner = Activities[activitycount];
                context.ScheduleActivity(itemInner, onCompleted);
            }
            catch (Exception ex)
            {
                Logger.Log.Logger.LogData(ex.Message + " in activity DataTableForEach", Logger.LogLevel.Error);
                if (!ContinueOnError)
                {
                    context.Abort();
                }
            }
        }
Beispiel #2
0
        private void onCompleted(NativeActivityContext context, ActivityInstance completedInstance)
        {
            try
            {
                activitycount = activitycount + 1;

                if (MoveNextRow)
                {
                    MoveNextRow = false;
                    rowcount    = rowcount + 1;
                    if (dtable.Rows.Count <= rowcount)
                    {
                        return;
                    }
                    else
                    {
                        DataRow dataRow = dtable.Rows[rowcount];
                        CurrentDataRow.Set(context, dataRow);
                        lstResult = Convert.ToString(dataRow[ColumnNumber]);
                        ListResult.Set(context, lstResult);
                        //activitycount = Activities.Count;
                        activitycount = 0;
                    }
                }

                // rowcount =rowcount++;

                if (activitycount >= Activities.Count)
                {
                    MoveNextRow = true;
                    onCompleted(context, completedInstance);
                    return;
                }
                if (activitycount == Activities.Count - 1)
                {
                    MoveNextRow = true;
                }
                var itemInner = Activities[activitycount];
                context.ScheduleActivity(itemInner, onCompleted);
            }catch (Exception ex)
            {
                Logger.Log.Logger.LogData(ex.Message, LogLevel.Error);
            }
        }