Добрый день! Создала задание :
string schedulerJobGroupName = "AvtoSynchWithLDAPProcessGroup"; //- Любое имя
string jobProcessName = "SynchWithLDAPProcess"; //- Название процесса
string schedulerJobName = "AvtoSynchWithLDAPProcessJob"; //- Любое имя
TimeSpan start = TimeSpan.Parse("08:00");
TimeSpan end = TimeSpan.Parse("10:00");
TimeSpan currentTime = DateTime.Now.TimeOfDay;
if ((currentTime > start) && (currentTime end))
{
int startOffset = 900;
AppScheduler.RemoveJob(schedulerJobName, schedulerJobGroupName);
var job = AppScheduler.CreateProcessJob(schedulerJobName, schedulerJobGroupName, jobProcessName, UserConnection.Workspace.Name, UserConnection.CurrentUser.Name);
var trigger = new SimpleTrigger(schedulerJobName, schedulerJobGroupName, DateTime.UtcNow.AddSeconds(startOffset));
AppScheduler.Instance.ScheduleJob(job, trigger);
}
else
{
int startOffset = 4;
AppScheduler.RemoveJob(schedulerJobName, schedulerJobGroupName);
var job = AppScheduler.CreateProcessJob(schedulerJobName, schedulerJobGroupName, jobProcessName, UserConnection.Workspace.Name, UserConnection.CurrentUser.Name);
var trigger = new SimpleTrigger(schedulerJobName, schedulerJobGroupName, DateTime.UtcNow.AddHours(startOffset));
AppScheduler.Instance.ScheduleJob(job, trigger);
}
return true;
Но при запуске выходит ошибка:
Date: 25.07.2017 18:40:45
Date (UTC): 25.07.2017 15:40:45
Exception Message: Невозможно получить значение колонки Name, так как она не была загружена
Exception Type: Terrasoft.Common.InvalidObjectStateException
Exception Source: Terrasoft.Core
Exception Stack Trace:
в Terrasoft.Core.Entities.EntityColumnValue.get_Value()
в Terrasoft.Core.Entities.Entity.GetTypedColumnValue[TResult](String valueName)
в Terrasoft.Core.Process.AvtoSynchWithLDAPProcess.AddToSchedulerScriptTaskExecute(ProcessExecutingContext context)
в Terrasoft.Core.Process.ProcessFlowElement.Execute(ProcessExecutingContext context)
в Terrasoft.Core.Process.Process.ProcessQueue(ProcessExecutingContext context)
в Terrasoft.Core.Process.ProcessActivity.Execute(ProcessExecutingContext context)
в Terrasoft.Core.Process.Process.Execute(UserConnection userConnection)
в Terrasoft.WebApp.VwSysProcessListPageEventsProcess`1.RunProcessScriptTaskExecute(ProcessExecutingContext context)
в Terrasoft.Core.Process.ProcessFlowElement.Execute(ProcessExecutingContext context)
в Terrasoft.WebApp.VwSysProcessListPageEventsProcess`1.ProcessQueue(ProcessExecutingContext context)
в Terrasoft.WebApp.VwSysProcessListPageEventsProcess`1.OnExecuted(Object sender, ProcessActivityAfterEventArgs e)
в Terrasoft.Core.Process.ProcessFlowElement.Execute(ProcessExecutingContext context)
в Terrasoft.WebApp.VwSysProcessListPageEventsProcess`1.ProcessQueue(ProcessExecutingContext context)
в Terrasoft.WebApp.BaseGridPageEventsProcess`1.ThrowEvent(ProcessExecutingContext context, String message)
в Terrasoft.WebApp.VwSysProcessListPageEventsProcess`1.ThrowEvent(ProcessExecutingContext context, String message)
в Terrasoft.UI.WebControls.PageSchemaUserControl.ThrowEvent(String message)
в Terrasoft.WebApp.VwSysProcessListPageSchemaUserControl.RunProcessButtonClick(Object sender, EventArgs e)
в Terrasoft.UI.WebControls.Controls.ComponentAjaxEvent.OnEvent(Object sender, AjaxEventArgs e)
в Terrasoft.UI.WebControls.Controls.Observable.FireAsyncEvent(String eventName, ParameterCollection extraParams)
в Terrasoft.UI.WebControls.Controls.ScriptManager.RaisePostBackEvent(String eventArgument)
в Terrasoft.UI.WebControls.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
в System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Form:
submitAjaxEventConfig: {"config":{"viewStateMode":"include","extraParams":{}}}
__EVENTTARGET: ScriptManager
__EVENTARGUMENT: PageContainer_VwSysProcessSectionPage_Grid_RunProcessButton|event|Click
__EVENTVALIDATION: /wEdAAOvVXD1oYELeveMr0vHCmYPrFHW+cRWVtoBd62cCaTjNTaERVpf4hfzb6sOLwCZwG3iwlUNutEg7pkrfiOU+6PFHdO6xQ==
PageContainer$VwSysProcessSectionPage$BaseFolder$TreeGrid_SM: [{"Id":"48ac198d-3dc2-405b-bfd7-5bfd363160fd","Name":"Все процессы","FolderTypeId":"9dc5f6e6-2a61-4de8-a059-de30f4e74f24","FolderTypeName":"Статическая","FolderType_Order":2}]
PageContainer$VwSysProcessSectionPage$Grid$TreeGrid_SM: [{"Id":"5b272b28-60fb-458c-87ef-799e203b6ed7","Caption":"Синхронизировать данные о пользователях с LDAP (автомат)","Name":"AvtoSynchWithLDAPProcess","SysSchemaIsInherited":false,"SysSchemaStateInSolution":0,"SysSchemaFolderId":"26f0ae40-c453-4b43-aab9-74d44fab9515","SysSchemaFolderName":"BPMonline CRM","SysPackageId":"8d3fd2a7-c3e3-42d1-ae09-34167e1cadde","SysPackageName":"CustomPackage","MetaDataModifiedOn":"2017-07-25T18:36:00","SysSchemaManagerName":"ProcessSchemaManager","SysSchemaInSolutionVersion":26}]
PageContainer$VwSysProcessSectionPage$DetailGridContainer9108b52371ec480587413e79ba1bc9f3$TreeGrid_SM: [{"Id":"7acd0d26-2a90-431f-a34d-7b98378e59af","FolderId":"48ac198d-3dc2-405b-bfd7-5bfd363160fd","FolderName":"Все процессы","CreatedOn":"2017-07-25T17:59:17","CreatedById":"df41e401-9385-4e5d-9c4f-42d5e36b9f64","CreatedByName":"Астапеева Анастасия Александровна","ModifiedOn":"2017-07-25T17:59:17","ModifiedById":"df41e401-9385-4e5d-9c4f-42d5e36b9f64","ModifiedByName":"Астапеева Анастасия Александровна","ProcessListeners":0,"VwSysProcessId":"5b272b28-60fb-458c-87ef-799e203b6ed7"}]
customDataField: {tempData:"{MainActiveTabId:\"PageContainer_a44185aa4ca64df9b5473ab4c9eb700d_ff9f207cf36b14104a931c6f65e50343_e6a6bf2d0d784062adc3b1914c85df3a\",PageContainer_VwSysProcessSectionPage_DetailsTabPanel_Collapsed:\"false\",PageContainer_VwSysProcessSectionPage_DetailsTabPanel_ActiveTab:\"0\"}",pageContainers:"[\"PageContainer$CtiPageContainer\",\"PageContainer$VwSysProcessSectionPage\",\"PageContainer$VwSysProcessSectionPage$BaseFolder\",\"PageContainer$VwSysProcessSectionPage$Grid\",\"PageContainer$VwSysProcessSectionPage$analyticsGridPageContainer\",\"PageContainer$VwSysProcessSectionPage$DetailGridContainer9108b52371ec480587413e79ba1bc9f3\",\"PageContainer\"]",instanceId:"6591ba57-65e7-4649-ad94-defe454538ca",pageUId:"5e5f9a9e-aa7d-407d-9e1e-1c24c3f9b59a",SysModule_selectedFolderId:"48ac198d-3dc2-405b-bfd7-5bfd363160fd",SysModule_activeDataSource:"PageContainer_VwSysProcessSectionPage_Grid_DataSource",tempUserContext:"[\"__VIEWSTATE6591ba57-65e7-4649-ad94-defe454538ca\"]"}
PageContainer_VwSysProcessSectionPage_BaseFolder_DataSource_ActiveRowPrimaryColumnValue: 48ac198d-3dc2-405b-bfd7-5bfd363160fd
PageContainer_VwSysProcessSectionPage_BaseFolder_DataSource_SelectedItemPrimaryColumnValues: ["48ac198d-3dc2-405b-bfd7-5bfd363160fd"]
PageContainer_VwSysProcessSectionPage_Grid_DataSource_ActiveRowPrimaryColumnValue: 5b272b28-60fb-458c-87ef-799e203b6ed7
PageContainer_VwSysProcessSectionPage_Grid_DataSource_SelectedItemPrimaryColumnValues: ["5b272b28-60fb-458c-87ef-799e203b6ed7"]
PageContainer_VwSysProcessSectionPage_DetailGridContainer9108b52371ec480587413e79ba1bc9f3_DataSource_ActiveRowPrimaryColumnValue: 7acd0d26-2a90-431f-a34d-7b98378e59af
PageContainer_VwSysProcessSectionPage_DetailGridContainer9108b52371ec480587413e79ba1bc9f3_DataSource_SelectedItemPrimaryColumnValues: ["7acd0d26-2a90-431f-a34d-7b98378e59af"]
PageContainer_Collapsed: false
PageContainer_MultiLevelTabs_ActiveTab: PageContainer_a44185aa4ca64df9b5473ab4c9eb700d_ff9f207cf36b14104a931c6f65e50343_e6a6bf2d0d784062adc3b1914c85df3a
PageContainer_SearchEdit: Поиск>
PageContainer_CtiPageContainer_NumberEdit: Введите номер телефона>
PageContainer_CtiPageContainer_TransferNumberEdit: Введите номер телефона>
ext-comp-1018: true
ext-comp-1007_ActiveTab: ext-comp-1008
ext-comp-1010_ActiveTab: ext-comp-1011
PageContainer_TopControlLayout_Collapsed: false
PageContainer_CtiControlLayout_Collapsed: false
PageContainer_ContentControlLayout_Collapsed: false
PageContainer_TopLeftControlLayout_Collapsed: false
PageContainer_TopRightControlLayout_Collapsed: false
PageContainer_LogoControlLayout_Collapsed: false
PageContainer_NavigationControlLayout_Collapsed: false
PageContainer_NavigationButtonsControlLayout_Collapsed: false
PageContainer_ControlLayout1_Collapsed: false
PageContainer_MultiLevelTabs_tools_Collapsed: false
PageContainer_CtiPageContainer_Collapsed: false
PageContainer_CtiPageContainer_MainControlLayout_Collapsed: false
PageContainer_VwSysProcessSectionPage_Collapsed: false
PageContainer_VwSysProcessSectionPage_MainControlLayout_Collapsed: false
PageContainer_VwSysProcessSectionPage_LeftControlLayout_Collapsed: false
PageContainer_VwSysProcessSectionPage_RightControlLayout_Collapsed: false
PageContainer_VwSysProcessSectionPage_CustomSearchContainer_Collapsed: false
PageContainer_VwSysProcessSectionPage_FolderLayout_Collapsed: false
PageContainer_VwSysProcessSectionPage_FilterEditLayout_Collapsed: false
PageContainer_VwSysProcessSectionPage_BaseFolder_Collapsed: false
PageContainer_VwSysProcessSectionPage_BaseFolder_TreeGrid_Collapsed: false
PageContainer_VwSysProcessSectionPage_FilterEdit_Collapsed: false
PageContainer_VwSysProcessSectionPage_FilterEdit_toolbar_Collapsed: false
PageContainer_VwSysProcessSectionPage_GridTabPanel_Collapsed: false
PageContainer_VwSysProcessSectionPage_GridTabPanel_ActiveTab: 0
PageContainer_VwSysProcessSectionPage_GridTab_Collapsed: false
PageContainer_VwSysProcessSectionPage_GridTab_TabActivated: true
PageContainer_VwSysProcessSectionPage_DetailsTabPanel_Collapsed: false
PageContainer_VwSysProcessSectionPage_DetailsTabPanel_ActiveTab: 0
PageContainer_VwSysProcessSectionPage_DetailTab9108b52371ec480587413e79ba1bc9f3_Collapsed: false
PageContainer_VwSysProcessSectionPage_DetailTab9108b52371ec480587413e79ba1bc9f3_TabActivated: true
PageContainer_VwSysProcessSectionPage_Grid_Collapsed: false
PageContainer_VwSysProcessSectionPage_Grid_ButtonsControlLayout_Collapsed: false
PageContainer_VwSysProcessSectionPage_Grid_TreeGrid_Collapsed: false
PageContainer_VwSysProcessSectionPage_DetailGridContainer9108b52371ec480587413e79ba1bc9f3_Collapsed: false
PageContainer_VwSysProcessSectionPage_DetailGridContainer9108b52371ec480587413e79ba1bc9f3_ButtonsControlLayout_Collapsed: false
PageContainer_VwSysProcessSectionPage_DetailGridContainer9108b52371ec480587413e79ba1bc9f3_TreeGrid_Collapsed: false
PageContainer_VwSysProcessSectionPage_BaseFolder_DataSource_ActiveRow: {"isNew":false,"changes":null}
SessionID: vjhiulo4tqt3g2qjohn3szj5
Request URL: /0/ViewPage.aspx?Id=5e5f9a9e-aa7d-407d-9e1e-1c24c3f9b59a&ActiveTabId=PageContainer_a44185aa4ca64df9b5473ab4c9eb700d_ff9f207cf36b14104a931c6f65e50343_e6a6bf2d0d784062adc3b1914c85df3a
Request Path: /0/ViewPage.aspx
Request UrlReferrer: http://afina.pbank.ru/0/ViewPage.aspx?Id=5e5f9a9e-aa7d-407d-9e1e-1c24c3f...
Request Type: POST
User Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.89 Safari/537.36
User Host Address: 10.1.3.154
User: baal
Is Authenticated: True
Authentication Type: Forms
Is Secure Connection: False
Application Version: 5.4.0.2460
Application Path: C:\WebAppReloaded\App\Terrasoft.WebApp\
Application Virtual Path: /0
Application Trust Level: Full
Machine Name: AFINA
Is Local: False
Process ID: 11108
Process Name: w3wp.exe
Process Account Name: PBANK\adminmts
Thread Account Name: PBANK\adminmts
OS Version: Microsoft Windows NT 6.1.7601 Service Pack 1
Net Framework Version: 4.0.30319.36365
DBExecutor Type: MSSqlExecutor