BizTalk Orchestration: Transaction, Unusual and Debug
Introduction to Ulrich Roxburghmicrosoft Corporation 2001 Introduction: This article explores the transaction support provided in Microsoft BizTalk Orchestration Services and examines how to use transactions and exception handle support to handle possible errors in the plan. Also explore how to debug programs and various components in the plan. The objects of this article are designers and developers who implement long-term business processes with BizTalk OrcheStration Services. Introduction Orchestration and Transaction: Summary Introduction The Errors Process Debugging Plan Introduction Introduction Based on Microsoft® BizTalkTM Orchestration Designer, users can design a long-term running business process, specify one implementation for a single operation constituting these processes, and compiles the information It is an executable XML representation that is a XLANG plan. The created plan is distributed in a loosely coupled and scalable manner, institutional, and application environment. However, since these processes have highly dispersed properties, the possibility of errors and abnormalities in the implementation plan is larger than short-term business processes. Orchestration Designer provides a visual design and development environment that is separated from the process of the process from the process. With this tool, the developer can specify an implementation for a single operation constituting these processes, and can be compiled into an executable XML representation. BizTalk Orchestration Designer provides a wide range of programming constructs, including transactions and exception handling semantics. The transaction is used to form a set of operations into a separate logical work unit to ensure that all work performed in the group is completed, otherwise all work is revoked. The operational gain provides the most standardized structured and reliability. This not only supports short-term affairs, but also supports transactions across multiple long-term business processes, as well as timed transactions. Abnormal processing provides more logic to undo the result of the transaction when an error occurs, or provides another set of operations to take. Abnormal handling includes "according to failure" and "compensation" processing, for supporting error handling of long-term business processes. Finally, this paper explores various methods for debugging and error correction of BizTalk Server Orchestration Services and BizTalk Messaging Services. Orchestration and transaction: What is the transaction? Humans have been engaged in a variety of affairs (transactions) very early. In a typical case, a buyer and a seller have discussed the right price for some goods. Assumptions have been agreed, and the buyers will give money to the seller to exchange goods. The most important point here is that the entire transaction or continues, or all end. If the seller gets the money, the buyer gets the goods, they are happy. If the seller does not get money, he does not give buyer goods, and the entire ending is still acceptable. However, if the buyer pays the money, the buyer is not happy. Similarly, if the seller is transferred to the goods, the seller is not happy. If the buyer and the seller do not believe each other, the other party will fulfill their respective sales commitments, you can help some intermediary services trusted by both parties. For the implementation of the business, the buyer will hand over the money to the middleman, and the seller will hand over the goods to the middle. The middleman then ensures that the seller receives the money and the buyer receives the goods. These are related to transactions with a computer? Imagine the process of payment through the banking application: The payment is proposed from an account (the value of a record in the database is reduced) and stored in another account (the value of a record in another database). This series of operations must be like a champion (ie, just a single operation alone).
This is called a transaction (this noun in English is from "Transformation Action" [Conversion Action]). One transaction is an operation or a series of operations to convert a system from a consistent state to another. The transaction follows a set of properties, called the ACID attribute:
Indockery: One transaction represents a unacceptable work unit. All modifications or all of a transaction are executed, or no modifications are made. Consistency: Once it is completed, the transaction must maintain the integrity of the data in the system. If the transaction makes a data modification on a database, the database is consistent inside before the transaction begins, and the database must still have internal consistency when the transaction is completed. Ensure this property is generally the responsibility of application developers. Isolation: The modifications made in parallel business must be separated from other parallel business. Parallel running the isolated transaction will make a modification of the internal database consistency, completely like each transaction is serial running. Persistent: After the one is completed, all modifications are permanently exist in the system. Even if a system failure occurs, each modification still exists. As in the simulation of affairs (transactions) in the market, all parties involved in the usual transaction have no control over the other party (for example, in transactions involving two separate databases), Endes in the party cannot guarantee the indivocile process of the process. Like the simulation scenario in the market, the method of solving this problem is to introduce a third party or a mediation to ensure that both operations occur, or both operations do not occur. On Microsoft® Windows NT® 4 and Microsoft Windows® 2000, this intermediary is called Microsoft Distributed Transaction Coordinator (Distributed Business Coordinator, MSDTC). MSDTC was originally published with Microsoft SQL ServerTM 6, providing an object-based programming model for creating, eliminating, managing, and monitoring individual transactions. MSDTC uses some help services (also known as resource manager) to ensure that the ACID attribute of the transaction is maintained. The resource manager has an object affected by the transaction and is responsible for persistent storage resource objects. A resource must let an resource manager participate in transactions with Distributed Transaction Coordinator. Also note that Distributed Transaction Coordinator and Explorer can distribute multiple nodes across the network. To coordinate the various operations of a transaction, maintain the ACID property, the Distributed Transaction Coordinator and Explorer use a protocol, called two-step completion protocol. The algorithm for the two-step completion protocol is a series of complex operations, which increases with the number of resources (thus also increase the number of resource manager). The most important feature of the agreement is that the records to update are locked during the completion of the two steps. This lock for database records remains or completes until the transaction is abandoned or completed. This factor is of great significance to the transactions in the long-term business process. Although the Distributed Transaction Coordinator greatly enables programmers to easily use transactions to their application environments, this model still has a big weakness. The transaction is usually implemented in the component (initial, completed or given up). When the operation constituting a complete transaction is dispersed in a plurality of components (ie, in one component is initially, and in another component is completed or discarded), it is difficult to reuse these components to implement the combination of different components. New business. In the figure, Transaction 1 (transaction 1) is initially in the Customer component, but is done in the Invoice component. There is also an Agent component for initial another transaction.
Now, if another business is created, another transaction is created by Customer and Agent, which cannot be easily created, because the two components are initially a transaction, but two transactions These transactions are not completed again (completed or abandoned). In 1997, Microsoft released Microsoft Transaction Server (and issued a new version of MSDTC). The product revolution provides a statement model for transaction programming. Now, the programmer is not in the component for transaction semantic programming (ie, hardware encoding is in essentially), but the component is made as a whole, and the transaction is declared from the independent COM component, thereby implementing Complete business. This new model enables programmers to write their transactions in a much simple manner, greatly increasing the repetition of transactional components. COM components become components for business transactions. All services provided by Microsoft Transaction Server have now been transferred to Windows 2000, and is significantly enhanced as a COM service under Windows 2000. Com provides five levels of transactional support:
Disabled: This selection specifies the component ignores COM transaction management. Not support: This selection specifies that components do not participate in transactions, or propagate all other components. Support: This selection specifies, if there is a transaction being running, the component will be included in the transaction. However, components will not initially. Required: This selection specifies, if there is a transaction being running, the component will be included in the transaction. If no transaction is running, you will create a new transaction for the component. Requires New: This selection specifies that you always create a new transaction for the component. BizTalk Orchestration provides a sophisticated graphic programming example with existing Com services, with transactional programming and exception handling semantics, providing revolutionary transaction programming semantics with COM services. There are multiple levels of transactional support in BizTalk Orchestration. The first level support comes from the entire plan as a COM transaction component. Moreover, you can specify a transactional semantic for a set of operations, and the specific method is to package these operations in a transaction shape. This makes it possible to support short-term DTC-style transactions (transactions managed by Distributed Transaction Coordinator, using the underlying COM service), and support long-term transactions (ie, run more than a long period of time), and timing transactions (ie A transaction may occur after a longer period of time). The plan also supports transaction compensation and exception handling semantics. As a business participant's business process Figure BizTalk Orchestration Services provides the first level of transaction supporting the entire plan as a transaction component. The planned transactional support is the declaration setting, which is similar to the Com component declared transactional support. The plan is then initially initiated by a COM component, which may have been run in a transactional context, or it may not be the case. In essence, it is planned to implement the transaction COM component. You can set the program's transaction model by opening the "Properties" dialog box of the Begin shape at the beginning of the plan. Its default settings "will be included in the plan". To take the entire plan as a transactional component, select "Treat the XLANG Plan as a COM Component". You can also set the planned transaction activity:
If the XLANG plan does not support the transaction, select Not Supported. If the XLANG is planned to participate in a COM transaction, please select Supports. If all COM components created by XLANG Scheduler Engine and COM are transactional, select Requires. If the XLANG plan must be involved in a new transaction, select Requires New. If this setting is enabled, the COM service automatically initially has a very different transaction with the caller's transaction. With this mechanism, the compilation engine effectively provides the service process automation in a single COM component. That is, the entire plan works as a single COM component, and the COM component can support the transactions described above. Note that when the entire plan is used as a component, the plan itself cannot contain any transactions (the plan can contain a transaction shape, but the plan will not be compiled), and there is some restriction in the program, using parallel executions - When using the fork shape in the plan, all transactional operations must occur in one execution stream. Note that it is planned to be used as a mechanism for a self-contained transactional component to rely on the underlying COM service to manage transactions. If the transaction is discarded, the operation related to the transactional component is restored. The transactional component can be a COM component, a script component, or a transactional Microsoft message queue. In this example, the plan has been configured to "treat the XLANG program as a COM component" (in the "Properties" dialog of the Begin). It is also configured to require a transaction. The implementation plan (not shown) reads a message from a transactional message queue (receive queue) and writes the message to another transactional message queue (send queue). If the plan is performed by instantiating it from a COM component, the COM component is also configured to require a transaction, then the transaction is completed (component call setcommit), read a receiving queue The message is written to the send queue. However, if the COM component abandoned the transaction (call setabort) due to a reason, the message read from the received queue will be replaced back and no message is written to the send queue. Planned transaction type If a planned transaction model is set to "Inited transaction in xlang Schedule" (default), the program can include a transaction shape. To add a transaction to the plan, drag the Transaction shape from the flowchart palette, put it, allowing it to include all the operations to participate in transactions. One or more shapes can also be nested in an outer transaction shape. Short-term transactions gathered a range of operations within its boundaries, but they could not nested another transaction. However, long-term transactions and timing transactions can be used to aggregate any operational combination - short-term affairs, long-term affairs or timing transactions. However, please note that the business is nestled deeply two floors. You can set the properties of the transaction, and the method is "Properties" of the transaction shape and the Transaction Properties dialog box. You can rename a transaction and set a transaction type (timing, short or long) or other transaction properties. In addition, in the appropriate case, you can add a "failure" code or "compensation" code to the plan. "According to the failure" code, create a new page on the plan ("Failed to the failure" page), used to design a replacement business process, which is used to process the selected transaction.
This option can be used for all transactions (see "Processing of the Transaction Failed" later in this article). "Compensation" code also creates a new page in the transaction ("Transaction Compensation" page), used to design a logical work unit that has been replaced to cancel the completed nested transaction. This option is only available for nested transactions (see "transaction compensation processing") later in this article. Other transaction attributes that can be set have: timeout: This property sets a time, automatically abandon or retry after the transaction is running this time. This property cannot be set for long-term transactions. Retry counting: This property determines that a process in the short-term transaction is not completed, the number of times will be run. For each retry, the status of the application is reset to the starting point of the transaction within the transaction. This option is for short-term transactions. Back time: This property determines the time interval between every attempt. The back time is set with the retringency value, and it is determined that the time is required before the next transaction is trying. The rear refund is an index. The post-extent of 2 seconds results in an interval between 2, 4, 8, 16 and other seconds between each retry. The formula is b ** r (R movably), where b = back time, and R = current retry count. If a specific transaction retry the back time is more than 180 seconds, the XLANG plan instance will be "dehydrated" to a persistent database. This option is for short-term transactions. Isolation: Isolation determines the extent to which data within parallel transactions can be accessed. This option is for short-term transactions. Alternative:
Serialization, is used to prevent parallel business from being modified, and until the selected transaction. This is the strongest limiting in four isolations. Reading unfinished, allowing parallel transactions to be modified in data modifications before the selected transaction is completed. This is the weakest limit on four isolations. Read the completed person to prevent the selected transaction from accessing data modifications in parallel transactions, until it is completed. This option is the default setting of Microsoft SQL Server. Repeatable read, require reading lock, and until the selected transaction is completed. Short-term (DTC style) is scheduled to set a transaction shape, which defaults to Short-term transactions (the transaction box is filled as gray). This transaction type depends on underlying transaction support from COM and MSDTC. Short-term transactions allow a atomic (single, inseparable) work unit to be created from several discrete and independent units. Although the properties of the transaction can be set in the "Properties" dialog, the transaction boundaries defined in each operation in the transaction shape, but short-term transactions depends on transaction attributes set to the implementation port connected to this operation, as well as components. The transaction property, or the script referred to in the port. Specifically, this means that the implementation of the operational shapes should be a COM component that supports the transaction, marked as a transactional script, or reading and writing to the transactional message queue, so it is possible to successfully give up these operating. If the transaction shape contains an operation that is connected to an implementation port that does not support the transaction, the work performed by the COM component, the script, or queue is not restored when abandoning the transaction. Nevertheless, non-transactional components can still be used to implement a part of a transaction. Plan to display three operations included in the short-term transaction. In the implementation of the present plan (not shown), the first operation is a message to reach a transactional message queue (receive queue). A COM component is then instantiated and a method is called for the component. Methods A dialog box allows users to choose complete or abandon transactions (setCommit or setabort on the COM component) in the method. The last operation gains the original message and writes it to another transactional message queue (send queue). When performing this plan, if the user selects calling setCommit, read the message from the receiving queue and put it in the send queue. However, if the user selects calling setabort, the message is still left in the receiving queue. Finally, it is important to note that for each instance of the plan, a new instance of the Query Abort component is instantified when the short-term transaction is started, and the example is eliminated when the transaction is terminated (given or completed). The real-time activation model is the same as the real-time activation model delivered for the first time with Microsoft Transaction Server. Any state that the component is maintained is lost. Long-term affairs cannot use traditional short-term transactions when investigating business processes that may be uncertain. This is because each short-term transaction keeps database locks and resources. Given that at a particular time, there may be thousands of business processes on the computer run, and the number of resources maintained is unrealistic. Therefore, the transaction type is set for a long time. In addition to "isolation", long-term transactions have all ACID properties described above. Isolation means that there is no thing in the transaction to see (more way not to update) the data being used within the transaction. The reason for isolation is that the result of the transaction is unknown, until the transaction is completed or abandoned, because the current data may be effective or invalid. Given that the data may be invalid, other things are not allowed to access data to prevent misuse.
Isolation is an attribute of short-term transactions (one of the ACID properties), which is implemented by the records in the lock database. In distributed long-term transactions, you cannot lock data in the database in a long period of time, and you cannot lock data in a cross-mechanical distribution database (imagine how you can convince another organization, let you lock your database in his database. Long-term affairs are specifically used to accumulate operational sets in finer atomic working units, which can exist in time, mechanism, and application environments. In long-term affairs, other transactions can see data being used by this business. Of course, long-term affairs can also be composed of the operation of short-term transactions (short-term transactions can be nested in long-term transactions). For example, please imagine the situation of initial business processes when you receive a purchase request. The request is recorded to the database and then sent to the requested approval. This may take a while (weeks!) Before you can receive a ratification response, and the response is also recorded to the database, and the purchase order is sent to the supplier. Receive initial requests (and record) and reception response (and record) each are each constituted (receive and recording) by multiple operations (reception and recording). In this case, short-term transactions are used to accumulate associated operations into individual atomic transactions (receive a message and connect it to the database). However, you cannot get a receiving purchase request message and receive approval messages to a single short-term transaction because this will lock the record line in the database. What will I do if I do 5000 users at the same time? Therefore, use a long-term transaction to gather two short-term transactions, and these two short-term transactions can be separated for a long time. What will I think when I do this? First, in a short-term transaction, receive the purchase request and update the database. If you have any problems, the transaction will be given, all changes will be revoked; otherwise, the transaction is completed. Then plan to wait for the arrival of the approved message. When the message arrives, the database is again a transactional update. If you have any problems, "send to the supplier" transaction is automatically abandoned. However, it is impossible to abandon the "receiving PO" transaction because it has been completed. In this way, the first transaction must provide some code for undo its procedures, so that the transaction has been given to abandon it. This is called compensation transactions (see "transaction compensation processing" later in this article). In this case, if some conditions have caused "sending to the supplier" to abandon, resource manager and the MSDTC will be responsible for revoking all the works conducted by the Supplier. The "Compensation" code provided by "Receiving the PO" transaction will revoke the completed changes to the firm. A plurality of short-term transactions are gathered (synthesized) into a long-term transaction, which is generally controlled by long-term transactions. Typically, long-term transactions will contain multiple nesting short-term transactions. Based on the needs of the business process described in the XLANG plan, all of the business processes (except as the begin shape and END shape) can be included in long-term transactions, as shown here. Timed transaction timing transactions are used to trigger to abandon long-term transactions if they are not completed during the specified time. Long-term transactions do not use timeout properties on the property page. Determine the length of time that a business process may spend in advance is usually very difficult. However, it is possible to make reasonable estimates for a particular operation in the business process, such as the arrival of messages. Therefore, a timing transaction can be used to aggregate short-term transactions, and the arrival of messages in the specified period of time. If the message comes in time, the timing transaction is completed; otherwise, the timing is abandoned, and the short-term transaction will execute its "compensation" code.
In the example, short-term transactions are used for "remittance". The transaction gathers two operations of "withdrawal" and "initial wire". When the "initial wire transfer" operation is completed, the business process sequence outsource nested transactions. At this point, the nested transaction is completed; the money is proposed from the bank account and sent to a destination. At this point, the service process sequence flows to the "Waiting confirmation" operation in the outer transaction. In this case, the "wire" transaction is configured as a timing transaction. If the sender does not receive the money confirmation within the specified amount of time, the outer transaction will give up. This situation occurs, the business process sequence flows to the "Remittable Compensation" page for nested transactions, and then streams to the "failure of the wire" page for outer transactions (see "transaction compensation processing in this article" "). Timed transactions can also be modeled by two execution flows in the plan, one of the flows waiting for the message, and the other flow has a timer, which occurs after the specified time. No matter which event occurs first (the message arrival or timer timeout), the transaction is completed (ie, the completion or abandonment, respectively). However, in this way, it is a constraint to the ability to "self-dewater", and the timing business is always much more convenient. The transaction attribute of the implementation is as shown in the previous, and the operational shape used in the plan and the implementation of these shapes in the implementation port. The operational property of operation depends on the transactional attributes of the underlying implementation. This means that only the operations implemented by the transactional component will actually participate in the transaction. Specifically, this means that the implementation of the operational shape must be a COM component that supports transaction, marked as a transaction script, or reading and writing to the transactional message queue, so it is possible to successfully give up these operating. When the COM or script component is bound to the port implementation, you can set the transaction support for the COM application to set the same manner to set transaction support (disable, not supported, support, request, request, and request new). Implementation operations in transactions with non-transactional implementation ports are fully acceptable, but all changes made by these implementations will not be reduced. In any case, the transaction is not supported in the implementation port unless these ports are deal with the resource managed by the resource manager, and these resource managers are collaborated with Distributed Transaction Coordinator; this actually means most common databases. And Microsoft Message Queuing. Non-transactional situations are processed by the "failure" process (see "processing of" transaction failure in part after this article "). The last transaction attribute that can be set in port implementation is the ability to abandon transactions during an error during the processing of the component or script. With this mechanism, you can give up the current transaction by returning a COM error from a COM object or script. What caused the transaction to give up? How can a transaction be given? Transactions typically perform the process outflow transaction (transaction and end) or abandon. A number of reasons occurred in abandonment:
In the process stream encountered an Abort shape. There is a fault return code from the COM component, which specifies the abandonment in the port binding. Any binding technique can introduce a fault event in the system level to abandon the transaction. For example, Message Queuing may not be able to put a message into a queue. XLANG SCHEDULER ENGINE (COM application responsible for executing plan instance) encountered an error, which causes it to abandon the transaction in a certain instance. For example, there may be a DTC error. Pause a plan may require all the transactions in the program to abandon. A transaction timeout occurs within the transaction attribute. When abandoning, the transaction may try again, depending on the Retry Count property of the transaction group. If the transaction is re-attempting exceeds the number of times specified, the "failure" business process will be called. The "Press Failed" code provides a structured place for handling transaction failure. The problem in the plan is shown in the previous section, and short-term transactions can be used to provide automatic restore or recovery capabilities for certain operations in the plan. However, many operations cannot be implemented in a transactional manner, so that other forms of error handling, such as exception processing and compensatory transactions must be used to handle the wrong condition. This section focuses on how to build an error handling function to schedule. Involve, due to first examine the possible cause of the plan, three levels of errors may occur during XLANG Scheduler Engine is running. Its severity is from the weight, respectively:
Result in a fault error. System errors that cannot be captured by XLANG Scheduler Engine can cause the engine to fail with all scheduled instances that are running in the same COM application. The most likely causes of such faults are in a process, compiled a poor COM component. Such components should be tested outside the process prior to being placed. An error in an abnormality is caused, including the changing COM components that have lost synchronization, and the message queue does not exist, or the message transceiver channel does not exist. You can capture errors. Naturally, in the process of processing the plan, it is necessary to detect and process errors accordingly. Errors that can be captured within the XLANG program include returning a COM component (which applies to COM components or scripts) and various transactions caused by the album (access to the database). Handling error As the previous section, XLANG Scheduler Engine can capture applications and system errors. The XLANG program can be designed to respond to errors at runtime, this or via a certain decision rule to explicit a wrong result, or through transaction fault processing. To use the logical branch function of explicitly playing error results, you should test the return value after calling the COM component. This value is stored in the __status__ field from the _Out Message from the COM component (all components in the plan are implemented according to the message; this means that the message is incoming to the component, then another message Bessing from the component). To implement this operation, add a decision shape immediately after the operation of testing its results, thereby adding a rule to test the output of the COM component (_OUT .__ status__> = 0, where the negative HRESULT indicates the failure and positive HRESULT Indicates successfully). You can also measure the specific fault code, if applicable. These codes are defined in the header file WineError.h. Error can also be processed using troubleshooting. If the operation is included in the transaction shape, the operation is implemented as a COM component or script, and the component or script abandoned the transaction, and all the components of all participating transactions will be revoked. If the abandoned component is not transaction, you need to trigger your transaction to give up in some way. Set the error handling function in the COM Component Bind Wizard to abandon the transaction when the method returns a fault HRESULT. This option is only valid when using the communication operation using this port is within the process of transaction. This setting is made for COM components or scripts and returns a bad HRESULT, and any transactions that are currently running will be given up. The same function can also be achieved in the plan, and the specific method is to perform bad HRESULT with a Decision shape. If you return bad HRESULT, you will perform the Abort shape (but the error handling function in COM Component Bind Wiz is more convenient). Implementing the technical failure by means of Message Queuing or BizTalk Messaging, it is limited to the transaction fault process. Transactional support is specified in Message Queuing Binding Wizard, that is, indicating that the queue needs a transaction (for BizTalk Messaging, which is automatically performed). Note that the sending operation of Message Queu is successfully returned, indicating that the message has been successfully placed on the queue, but does not indicate that the message has been submitted.
The process of failure of the transaction will use a single operation of short-term transactions to get a more subtle business process, which is very effective in preventing a very effective mechanism for planning an error. However, for long-term business processes, several other mechanisms must be used to develop plans that can properly process errors. For short-term transactions, the boundary of the transaction is set by the transaction shape to declare mode, and then these transactions are to give up by calling setaborts within the transactional component or returns a captureable adverse HRESULT to abandon. If the operation within the transaction is bound to the transactional resource, the Distributed Transaction Coordinator will be responsible for restoring all the books in the transaction. Any work that has been made is completely revoked. However, in many cases, traditional short-term transactions are not inappropriate, which is unable to complete the required operation. This allows the "failure" processing function to add additional error handling semantics to the plan. The "according to the failure" processing function is implemented as a unique and independent stream in the plan, ie, is implemented on the independent processing page in BizTalk Orchestration Designer. When setting various properties of the Transaction shape, the business process designer can choose to add a code for the "failure" processing function. This makes another page "failure according to the transaction" to the plan. Business process designers can add additional logical functions here to process transactions. This code will be called if the transaction is abandoned (the transaction has been abandoned, and all transactional components have revoked their work). Now, when short-term events are abandoned, any binding to non-transactional resources (such as sending emails) will not be restored. More operations can be added to the "failure of transactions" process pages to undo these non-transactional operations (for example, send another e-mail, declaring the first email should be ignored). Of course, "according to the failure" code can be almost anything, but not necessarily limited to the operations aggregated in the transaction. Other work may also be required when the transaction is abandoned. During a typical business process, abandoning business and cleaning up has been made. At least, it may be necessary to record the transaction failure, but other operations are often needed, such as letters aware of the results of the transaction. Once a transaction failure occurs, the "Press Failed" processing function can be used to implement these operations again. "Press the failure" processing feature can also be used for long-term transactions or timing transactions. For example, if a timing transaction is set to wait for a message receipt, the "Press Failed" processing function can be used to warn the corresponding user when the message is not arriving. There is also a situation with "according to the failure" processing function, that is, any operation that occurs behind the transaction, is unable to determine whether the transaction is completed or abandoned unless the message passes the information to these operations. For example, consider a plan with a number of operations, some of which are gathered into transactions. A message (probably an XML document) passes the plan from the head until the end. If the transaction is done, everything runs normally and the message is operated (the operation is done). However, assume that one of the operations abandoned the transaction. In this case, all changes to the message will be restored. The operation behind the transaction will not be able to find the transaction is completed or abandoned (not delivered), and it does not know which operations have successfully handled the data, which operation failed because all changes to the message were restored. The "failure of the transaction" page is the best way to implement this program. "According to the failure" code will be executed after the transaction is discarded, and it is important that all changes to the message can be provided to "according to the failure" code.
In addition, "according to failure" code can be set in the message to indicate that the transaction has occurred in order to take the corresponding operation. The transaction compensation processing function "Press the failure" processing function works in a single transaction. For long-term business processes and nested transactions (as discussed earlier, transactions can nest in long-term operation or timing transactions), transaction abandoning processing functions become more complicated. The example shows the timing transaction "wire", which gathered a short-term transaction "remittance." If you run this plan, the "remittance" transaction will row (and will be completed). Plan then wait for the correct confirmation that the wire takes place. If you confirm that there is no time you specified (timeout time for timing transaction settings), the timing transaction ("wire") will give up. However, it is not possible to abandon the inner layer ("remittance") because it has been completed. Even if the transaction provides "according to the failure" code, it is impossible to call it because the inner layer transaction has not failed. This situation is processed by providing "compensation" operations for the inner transaction. In the "Transaction Properties" dialog box of nested transactions, you can add "compensation" processing code, so that you can add another page, "Transaction Compensation", added to the plan if you "processing" according to failure. You can add code to this page to compensate for inner-layer transactions (completed). With nested matters, multiple "transaction compensation" and "failure to fail" by transactions are exist in planning, and performing more than one operation to perform the desired error handling, is completely feasible. In the previous example, assuming that the transaction "remittance" has "failure" and "transaction compensation" and "transaction compensation", the Timers "wire" has the "failure of the transaction" page. This plan may have two failures. The first is "remittance" transaction waiver, and thus the "remittance" transaction "processing" by failed "is implemented. Typically, the "Press Failed" processing function of the "wire transfer" transaction does not execute because the results of the inner transaction do not affect the result of outer transactions. In this case, since any confirmation will not be sent, the timing transaction of the outer layer will eventually fail, thereby calling "wireless" code. The second situation is "remittance" will be completed, but there is no confirmation message from timeout, resulting in a timing transaction. In this case, the "compensation" processing function of "remittance" will be executed first, and then the "wire transfer" processing function is handled. The debugging plan is the same as the traditional development system, and now provides the visual debug utility that is uninterested, just as those of Microsoft Visual Basic® and Microsoft Visual C ®. Microsoft BizTalkTM Server does not provide a graphical debug utility for the preparation plan. However, remember that the preparation plan is a different process of executable different from the traditional short-term synchronization process, so there is not enough single traditional debug model. When designing a planning plan with BizTalk Orchestration Designer, plan drawings are actually a business process diagram. To represent a process, we must apply three techniques:
Operation, this always transmits one of the messages or receives messages. Message, that is, the message sent or received. The port is sent to it or receives the message from it. In addition, since a process represents a process, there is a sequencing concept from one operation to another. When compiling and then performing a plan, a plurality of instances typically have an initial plan, as a single (long-term) executable process. To debug these executable procedures, tracking, and conventional tuning combined proof is effective. For the order of the debugging schedule (from one operation to another), tracking is useful. For implementations that debug a single operation, traditional debugging mechanisms can be used. Combining these two means can be commissioned for the most effectively. Tracking Planning When the plan is running, the plan is performed under the control of the XLANG Scheduler Engine, ie it is a COM application. When you install BizTalk Server, a separate instance of the planner is created, named XLANG Scheduler (default). You can also create custom COM applications with the XLANG plan. These COM applications (default or custom) When the plan is executed, a variety of events can capture and display events. BizTalk Server provides a tool called XLANG Event Monitor for capturing and displays these events. XLANG Event Monitor can subscribe to events published by host applications on any number of distributed computers, and can store these events for future analysis. When the XLANG Event Monitor receives events from all the XLANG plan host applications on the local computer at startup. The main window shows all COM applications that host the XLANG plan, and show all the scheduled instances currently running or completed for each host COM application. The encoding method is as follows:
Green Point: Represents a running xlang program. Black Point: Represents a successful XLANG plan. Red Point: The XLANG plan that represents an error. Blue Snowflakes: Represents a "dehydrated" xlang plan. Blue Line: represents an XLANG plan that has been suspended (or suspend). It is planned to stop until it is restored or terminated. Each of the additional examples has a unique identifier (instance GUID) for the exemplary examples. The listed scheduled instances can be paused or terminated from the XLANG Event Monitor. XLANG Event Monitor can also be used to start a new instance of the plan, that is, select the COM application you want to host the plan instance, and select the appropriate plan file (.skx file). All events of the specific plan instance can be viewed by double-clicking on the plan instance in the XLANG Event Monitor. It is also possible to screen for the displayed events, thereby only show events such as transactions or errors. Once the event is captured, it can be saved to the disk and reloaded, displayed later. Components in the debugging program Although the plan itself is unable to load into a visual environment, it is possible to debug these plans. This approach is identical to the standard COM component called from the client application (because the program is implemented as a COM application, the latter instantiates and calls these custom COM objects). To debug a Visual Basic component, you will be used in Visual Basic as in the past. Note that the components must be compiled into "Compile as Native Code" and "Creating Symbolization Test Information". During the debugging process, the "Optimized" checkbox should also be selected. You can then set breakpoints, which will then integrate development environment running components from Visual Basic. After the component is executed, it will run normally, until it tries to instantiate the component and perform one method on the component. At this time, the execution will be stopped at the set breakpoint. At this point, the components can be commissioned as usual. Note: If the XLANG Scheduler Engine has loaded DLL, it will not be compiled. If this is, you must use the Component Services application to close the XLANG SCHEDULER ENGINE. The specific method is to start the Component Services application, find the XLANG Scheduler Engine COM application, click "Close" on the context menu (right-click). Then you should compile the components. Also, if BizTalk OrcheStration Designer is running, there is a menu option to "Shut Down All Running XLANG Schedule Instances", which can be used to close the operation. When this option is selected, all the XLANG plans will be closed, and the lock to the DLL is released so that it can be compiled. Other commissioning reminders In addition to the progress of the XLANG Event Monitor tracking plan, you can also use other system monitors to detect errors in the running plan, and the implementation of the tracking plan. The error caused by xlang scheduler engine will appear in the Application tab of the Event Viewer. In the Event Viewer, these events are marked as the XLANG Scheduler error.
If necessary, you can also filter the events shown in the Event Viewer to showcase this event type. The Wfbinding error group in the event viewer is that a fault has occurred in the Message Queue interface of each specific instance between BizTalk Messaging Services and BizTalk Orchestration Services. BizTalk Messaging Services Messaging Port The Orchestration port settings, requires you to enter the Orchestration port name manually, and once you take the Orchestration port name, a Wfbinding error occurs. Another common error is to analyze verification errors. These errors are often caused by the instance documentation that does not comply with the document specification created in BizTalk Editor. In this case, the document is submitted to the "hanging queue" and records the error record in the Event Viewer. You can check and copy the document content to the clipboard by right-clicking on the project in Hualies. These problems can often be solved by paste the clipboard content into a text editor (such as "Notepad") and save the file. Now you have a document instance on the file system, you can open a document specification in BizTalk Editor and use the "Tools Instance" menu item to confirm your existing document instance. Note that even if the dialog is default * .xml, you can still confirm other file types, such as * .csv (if you have a flat file schema). Once you have successfully verified the document, you can save it to WebDAV. For performance reasons, the Microsoft BizTalk Server 2000 does not read the document definition or mapping from WebDAV. This aspect significantly improves performance, but it also brings more work that may lead to version problems. In particular, BizTalk Messaging Services does not refresh any files saved in WebDAV to the runtime engine. When you change the document specification and save it to WebDAV, you must also turn on the Messaging Manager to turn on the appropriate document definition, then press the "Apply" button. This will prompt the Messaging Manager to refresh the copy of its data files from the WebDAV. Similarly, when the mapping used in the document specification or channel for the envelope is changed, you must manually update the envelope. Other common problems include: Symptoms: The file is placed in a directory, but the received function associated with it does not pick up it. The reason may be: The file has a read-only attribute. In this way, there will be an event in the event record, pointing out that the received function cannot pick up a name of a name because it is read-only. The file name does not match the mask specified in the received function configuration, so that the configuration is corrected. A incorrect directory is specified in the receiving function configuration. If the directory exists, there will be no error symptoms. If the directory does not exist, the receiving function is disabled and an event is recorded. Correct the error and re-enable the received function in the property page. The BizTalk server has been shut down. Each reception feature is configured to run on a specific BizTalk server, and the server must be running. The SQL server has stopped. Receive functions If you cannot put the document on the Work queue, you will not remove it from the directory. Symptom: The file is removed from the pickup directory, but the subsequent processing did not occur. Possible cause:
Unable to analyze documents, or Messaging Manager has not been updated from WebDAV. There is no channel to match the Source ORG, DESTINA ORG, and DOC DEF specified in the receiving function properties. Please verify these properties to make sure there is a channel that matches it. Symptom: After submitting a single document, the same plan seems to start many times. Possible cause: A channel can be connected to one or more messaging ports. In this example, there is a plurality of channels to connect a message transceiver port for instantiating a preparation instance. You can subdivilize the complexity of programming issues in Visual Basic into multiple smaller manageable parts; Similarly, when you use BizTalk Server, you should separate, which section of the basic implementation contains questions you want to solve. For example, if you are unable to determine if you are submitted from BizTalk Messaging Services to whether the document contains the correct instance data, change the message transceiver port to output to a file to check the content of the document. To track the execution of the running plan, you can use Performance Monitor to display the results of the planned implementation component. Such results include, but are not limited to:
Monitor messages in the specific message queue (from Microsoft Message Queuing Queue Object). Microsoft Message Queuing Incoming and Output Messages (from Microsoft Message Queuing Service objects). The BizTalk Messaging documentation and data exchange (from the BizTalk Server object). BizTalk Messaging Suspended Queue (from the BizTalk Server object). Activity, abandoned or completed transactions (from the Distributed Transaction Coordinator object). Like Performance Monitor, Component Services MMC (Microsoft Management Console) can also be used to monitor the initial and completed transactions (you can also use SQL Profiler applications). Component Services applications can also be used to monitor instantiation of COM components installed as COM applications. This document is just initially elaborating the author's point of view and may make greater modifications before it is used for commercial publishing. This document is only used to provide information, and Microsoft does not make any promises or suggestions for the information in this article. Information in this document is subject to change without notice. All risks and consequences using this document are borne by the user. In this paper, the company, organization, product, people, and events are fictitious, with any real companies, organization, products, individuals or events without any direct or indirect associations. Users have a responsibility to comply with all applicable copyright laws. Without copyright, no part of this document is copied, stored in or inputs or inputs or enters or inputs or inputs or enters or enters or enters or enters or enters or enables any form or mode (electronic, mechanical, photocopy, recording or) or Other ways to propagate or use as other purposes.