0

我想知道网页控件是否可以使用 HandleExternalEvent,例如通过运行按钮的 Click 事件。

我尝试在没有令人满意的结果的情况下实现这一点,但是对于 Windows 窗体项目我没有问题。

    private string InstanciaGuid
    {

        get { return ViewState["instancia"].ToString(); }
        set { ViewState.Add("instancia", value); }
    }

    public BFPrueba01 _FacadePrueba01
    {
        get
        {
            return ViewState["facade"] as BFPrueba01;
        }

        set { ViewState["facade"] = value; }
    }

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
            ConeccionWWF();
    }

    private void ConeccionWWF()
    {
        WorkflowRuntime runtime = new WorkflowRuntime();

        Session.Add("runtime", runtime);

        ExternalDataExchangeService dataExchange = new ExternalDataExchangeService();
        runtime.AddService(dataExchange);
        _FacadePrueba01 = new BFPrueba01();
        dataExchange.AddService(_FacadePrueba01);

        runtime.StartRuntime();
        parameters.Add("oUsuario", oUsuario);
        WorkflowInstance instancia = runtime.CreateWorkflow(typeof(WWFsecuencial));
        instancia.Start();
        InstanciaGuid = instancia.InstanceId.ToString();

    }

    protected void btnComenzarWWF_Click(object sender, EventArgs e)
    {
        WorkflowRuntime runtime = Session["runtime"] as WorkflowRuntime;
        WorkflowInstance instance = runtime.GetWorkflow(new Guid(InstanciaGuid));
        _FacadePrueba01.RaiseEventSecuencial(new ComunicacionEventArgs(instance.InstanceId, MovementChangeType.Accelerate));
    }
4

0 回答 0