public virtual object Execute(CommandContext commandContext) { var calendar = new DateTime(); // new GregorianCalendar(); var messageEventSubscriptionEntity1 = new EventSubscriptionEntity(EventType.Message); messageEventSubscriptionEntity1.EventName = "messageName"; messageEventSubscriptionEntity1.ActivityId = "someActivity"; calendar = new DateTime(2001, 1, 1); messageEventSubscriptionEntity1.Created = calendar; messageEventSubscriptionEntity1.Insert(); var messageEventSubscriptionEntity2 = new EventSubscriptionEntity(EventType.Message); messageEventSubscriptionEntity2.EventName = "messageName"; messageEventSubscriptionEntity2.ActivityId = "someActivity"; calendar = new DateTime(2000, 1, 1); messageEventSubscriptionEntity2.Created = calendar; messageEventSubscriptionEntity2.Insert(); var signalEventSubscriptionEntity3 = new EventSubscriptionEntity(EventType.Signal); signalEventSubscriptionEntity3.EventName = "messageName2"; signalEventSubscriptionEntity3.ActivityId = "someOtherActivity"; calendar = new DateTime(2002, 1, 1); signalEventSubscriptionEntity3.Created = calendar; signalEventSubscriptionEntity3.Insert(); return(null); }
protected internal virtual void AddMessageStartEventSubscription(EventSubscriptionDeclaration messageEventDefinition, ESS.FW.Bpm.Engine.Persistence.Entity.ProcessDefinitionEntity processDefinition) { string tenantId = processDefinition.TenantId; if (IsSameMessageEventSubscriptionAlreadyPresent(messageEventDefinition, tenantId)) { throw Log.MessageEventSubscriptionWithSameNameExists(processDefinition.ResourceName, messageEventDefinition.UnresolvedEventName); } EventSubscriptionEntity newSubscription = messageEventDefinition.CreateSubscriptionForStartEvent(processDefinition); newSubscription.Insert(); }
/// <summary> /// Creates and inserts a subscription entity depending on the message type of this declaration. /// </summary> public virtual EventSubscriptionEntity CreateSubscriptionForExecution(ExecutionEntity execution) { var eventSubscriptionEntity = new EventSubscriptionEntity(execution, eventType); eventSubscriptionEntity.EventName = ResolveExpressionOfEventName(execution); if (activityId != null) { ActivityImpl activity = execution.GetProcessDefinition().FindActivity(activityId) as ActivityImpl; eventSubscriptionEntity.Activity = activity; } eventSubscriptionEntity.Insert(); LegacyBehavior.RemoveLegacySubscriptionOnParent(execution, eventSubscriptionEntity); return(eventSubscriptionEntity); //return null; }
/// <summary> /// EventSubscriptionEntity /// </summary> /// <param name="signalEventDefinition"></param> /// <param name="processDefinition"></param> protected internal virtual void AddSignalStartEventSubscription(EventSubscriptionDeclaration signalEventDefinition, ESS.FW.Bpm.Engine.Persistence.Entity.ProcessDefinitionEntity processDefinition) { EventSubscriptionEntity newSubscription = signalEventDefinition.CreateSubscriptionForStartEvent(processDefinition); newSubscription.Insert(); }