Custom Activity ( Thu ) Maintain state consistency and integrity
As mentioned in the previous section, the data to be processed to complete a review includes the following content:
LEdit and save the Workpiece
LRecord workpiece Review
LSave after runningWFInstance status
We can see that some data operations are performed in addition to the running of the workflow activity. For the custom audit activityWWFTechnical details and Application Experience (2)I mentioned the activity execution integrity and some implementation methods, which are not available here, because some of our data is processed outside the workflow. In addition to the workflow running environment, we must provide a function to collect data, edit the artifacts, and run the dataWFThe instance persistence is stored in the same transaction.
In addition, we need to specify persistonclose attribute. Otherwise, this status will not be recorded. This attribute is critical! We only want to automatically persist the workflow when the activity is completed so that the workflow can be transitioned to the next activity. However, if the conditions are not met, stop running (not stop !). This is also important for data status consistency.
To be continued ......