| 18 |   |  * The workunit has a nonzero [JobIn#Redundancyandschedulingattributes error mask] (indicating, for example, too many error results). In this case the handler might write a message to a log or send an email to the project administrator. | 
                      
                        | 19 |   |  * The workunit has a canonical result. In this case wu.canonical_resultid will be nonzero, and canonical_result will contain the canonical result. | 
                      
                      
                        |   | 19 |  * The workunit has a nonzero [JobIn#Redundancyandschedulingattributes error mask] | 
                      
                        |   | 20 |   (indicating, for example, too many error results). | 
                      
                        |   | 21 |   In this case the handler might write a message to a log or send an email to the project administrator. | 
                      
                        |   | 22 |  * The workunit has a canonical result. | 
                      
                        |   | 23 |   In this case wu.canonical_resultid will be nonzero, and canonical_result will contain the canonical result. | 
                      
            
                      
                        | 28 |   |  * DEFER_ASSIMILATION: the workunit will be processed again when another instance finishes.  This is useful for appliations where you want to see all the completed results. | 
                      
                        | 29 |   |  * Other nonzero values: the assimilator will log an error message and exit. Typically '''assimilate_handler()''' should return nonzero for any error condition. This way the system administrator can fix the problem before any completed or erroneous workunits are mis-handled by BOINC. | 
                      
                      
                        |   | 32 |  * DEFER_ASSIMILATION: the workunit will be processed again when another instance finishes. | 
                      
                        |   | 33 |   This is useful for appliations where you want to see all the completed results. | 
                      
                        |   | 34 |  * Other nonzero values: the assimilator will log an error message and exit. | 
                      
                        |   | 35 |   Typically '''assimilate_handler()''' should return nonzero for any error condition. | 
                      
                        |   | 36 |   This way the system administrator can fix the problem before any completed or erroneous workunits are mis-handled by BOINC. | 
                      
            
                      
                        | 52 |   |   | 
                      
                      
                        |   | 59 |  | 
                      
                        |   | 60 | == Using scripting languages == | 
                      
                        |   | 61 |  | 
                      
                        |   | 62 | The assimilator '''script_assimilator''' lets you write assimilator logic | 
                      
                        |   | 63 | in your language of choice (Python, Perl, bash, etc.). | 
                      
                        |   | 64 | '''script_assimilator''' takes a command-line argument | 
                      
                        |   | 65 |  | 
                      
                        |   | 66 |  --script filename:: name of script to handle a completed job | 
                      
                        |   | 67 |  | 
                      
                        |   | 68 | The script is called as | 
                      
                        |   | 69 | {{{ | 
                      
                        |   | 70 | script --wu_name X f1 ... fn | 
                      
                        |   | 71 | }}} | 
                      
                        |   | 72 | to handle a successful job, where X is the workunit name | 
                      
                        |   | 73 | and f1 ... fn are the output files of the canonical result, | 
                      
                        |   | 74 | or as | 
                      
                        |   | 75 | {{{ | 
                      
                        |   | 76 | script --wu_name X --error N | 
                      
                        |   | 77 | }}} | 
                      
                        |   | 78 | to handle an error job, were N is an integer encoding the error conditions | 
                      
                        |   | 79 | (see WU_ERROR_* in html/inc/common_defs.inc). | 
                      
                        |   | 80 |  | 
                      
                        |   | 81 | The script must be put in your project's bin/ directory. | 
                      
                        |   | 82 |  |