cdtj

Object update function

Blog Post created by cdtj Champion on May 19, 2015

Here we start,

 

since our business has learned that the system can be "customized",

all their erotic fantasies turned into code.

Today, Majic folder contains 181 files (more than 1Mb of pure text without comments).

 

The most common task is to update some entity caused by other entity.

How do we know this can be done by checkin/checkout/uncheck operators.

He here is a function to reduce amount of code and make it easier.

 

Entire code is added as attachment.

 

Here is usage example with comments:

macro::upd_val("iss",                          // object factory
               format("id=%d",other_issue_id), // where clause to get object (or objects)
               30,                             // delay to new retry if first iteration fails
               3,                              // amount of retries
               "summary",                      // attribute to update
               "test 1",                       // new value  
               "description",                  // another attr 
               "test 2",                       // another value  
               "z_etc_param",                  // amounts of attributes what can updated in 1 interation is infinite  
               "here is etc value");           // value can be string, integer or anything else.

 

This code will set summary, description and z_etc_param new values with 3 max retries if object is currently busy, delay between retries is 30 seconds.

I'm thinking about to add Plan B if all retries fail.

 

Is it easy enough, huh?

 

PS: Hope my spel coding is much better than my english :)

Attachments

Outcomes