public override void ExecutionStarted(IActivityExecution execution) { FormPropertyHelper.InitFormPropertiesOnScope(formProperties, execution); // make sure create events are fired after form is submitted base.ExecutionStarted(execution); }
protected Task <TResponse> SendGetAsync <TRequest, TResponse>(string path, TRequest request) where TResponse : SlackBaseResponse where TRequest : class { var queryParamsDictionary = FormPropertyHelper.GetFormProperties(request).ToDictionary(p => p.PropertyName, p => p.PropertyValue); var url = CustomUrlHelper.CreateQueryString(path, queryParamsDictionary); return(SendGetAsync <TResponse>(url)); }
public virtual IProcessInstance Execute(CommandContext commandContext) { var processEngineConfiguration = context.Impl.Context.ProcessEngineConfiguration; DeploymentCache deploymentCache = processEngineConfiguration.DeploymentCache; ProcessDefinitionEntity processDefinition = deploymentCache.FindDeployedProcessDefinitionById(ProcessDefinitionId); EnsureUtil.EnsureNotNull("No process definition found for id = '" + ProcessDefinitionId + "'", "processDefinition", processDefinition); foreach (var checker in commandContext.ProcessEngineConfiguration.CommandCheckers) { checker.CheckCreateProcessInstance(processDefinition); } ExecutionEntity processInstance = null; if (!ReferenceEquals(BusinessKey, null)) { processInstance = (ExecutionEntity)processDefinition.CreateProcessInstance(BusinessKey); } else { processInstance = (ExecutionEntity)processDefinition.CreateProcessInstance(); } //if the start event is async, we have to set the variables already here //since they are lost after the async continuation otherwise if (processDefinition.Initial.AsyncBefore) { // avoid firing history events processInstance.StartContext = new ProcessInstanceStartContext(processInstance.Activity as ActivityImpl); FormPropertyHelper.InitFormPropertiesOnScope(Variables, processInstance); processInstance.Start(); } else { processInstance.StartWithFormProperties(Variables); } return((IProcessInstance)processInstance); }
public virtual ProcessInstance execute(CommandContext commandContext) { ProcessEngineConfigurationImpl processEngineConfiguration = Context.ProcessEngineConfiguration; DeploymentCache deploymentCache = processEngineConfiguration.DeploymentCache; ProcessDefinitionEntity processDefinition = deploymentCache.findDeployedProcessDefinitionById(processDefinitionId); ensureNotNull("No process definition found for id = '" + processDefinitionId + "'", "processDefinition", processDefinition); foreach (CommandChecker checker in commandContext.ProcessEngineConfiguration.CommandCheckers) { checker.checkCreateProcessInstance(processDefinition); } ExecutionEntity processInstance = null; if (!string.ReferenceEquals(businessKey, null)) { processInstance = processDefinition.createProcessInstance(businessKey); } else { processInstance = processDefinition.createProcessInstance(); } // if the start event is async, we have to set the variables already here // since they are lost after the async continuation otherwise // see CAM-2828 if (processDefinition.Initial.AsyncBefore) { // avoid firing history events processInstance.StartContext = new ProcessInstanceStartContext(processInstance.getActivity()); FormPropertyHelper.initFormPropertiesOnScope(variables, processInstance); processInstance.start(); } else { processInstance.startWithFormProperties(variables); } return(processInstance); }