Ejemplo n.º 1
0
        public void Jump(string transitionTo, String instanceID, WorkflowProcess process, IWorkflowPersistent <WorkflowProcess, Action <String, Object> > processService)
        {
            IList <Action <IDbConnection, IDbTransaction> > commands = new List <Action <IDbConnection, IDbTransaction> >
            {
                (connection, transaction) => connection.Execute(ResourceManage.SQL_WORKFLOW_INSTANCE_UPDATE_RELATIONSHIP, new { RelationshipID = transitionTo, InstanceID = instanceID }, transaction),

                (connection, transaction) => processService.Persistent(process, (commad, entry) => connection.Execute(commad, entry, transaction))
            };

            DbFactory.Execute(commands);
        }
        public void Jump(string origin, string destination, String instanceID, WorkflowProcess process, IWorkflowPersistent <WorkflowProcess, Action <String, Object> > processService)
        {
            IList <Action <IDbConnection, IDbTransaction> > commands = new List <Action <IDbConnection, IDbTransaction> >
            {
                (connection, transaction) => connection.Execute(ResourceManage.SQL_WORKFLOW_LINK_DELETE, new { RelationshipID = origin, InstanceID = instanceID }, transaction),

                (connection, transaction) => connection.Execute(ResourceManage.SQL_WORKFLOW_LINK, new { NID = Guid.NewGuid(), InstanceID = instanceID, RelationshipID = destination }, transaction),

                (connection, transaction) => processService.Persistent(process, (commad, entry) => connection.Execute(commad, entry, transaction))
            };

            DbFactory.Execute(commands);
        }
        public void Jump(string origin, string destination, String instanceID, WorkflowProcess process, IWorkflowPersistent <WorkflowProcess, Action <Object> > processService)
        {
            IList <Action <ISession> > commands = new List <Action <ISession> >
            {
                (session) =>
                session
                .CreateQuery("delete from WorkflowLink c where c.RelationshipID=:RelationshipID and c.InstanceID=:InstanceID")
                .SetParameter("RelationshipID", origin)
                .SetParameter("InstanceID", instanceID)
                .ExecuteUpdate(),
                (session) => session.Persist(new WorkflowLink {
                    InstanceID = instanceID, RelationshipID = destination
                }),
                (session) => processService.Persistent(process, (entry) => session.Persist(entry))
            };

            DbFactory.Execute(DbFactory.OpenSession(), commands);
        }