cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X

How do Archetypes deal with duplication?

ablyth
7-Bedrock

How do Archetypes deal with duplication?

I have a question about how Archetypes deal with changes, i'll try to build a good example to explain:

 

My Archetype has 4 Expression Rules, i wish to change these so i have edited them in IntelliJ and re-reployed to my Platform with the following changes:

 

Rule 1: This rule has stayed exactly the same.

Rule 2: I have updated the Name of this rule as it previously contained a typo.

Rule 3: The logic of this rule has been updated, but the name remains the same.

Rule 4: Because of the changes in Rule 3, i have removed this entry as it is no longer required.

 

Ok so what happens when i re-deploy this? I suspect the Platform will intelligently 'undo' the previous Archetype deployment and then apply the new package, can someone clarify that this is the case?

 

Thanks!

Alan

4 REPLIES 4
MikeWunderlich
6-Contributor
(To:ablyth)

Hi Alan,

I will let some more experience person correct me if I am wrong, but at present I think if we are talking about just a standard artisan project the method I have witnessed is that artisan checks if a rule named the same as one you are uploading exists.  If yes, it deletes it and then installs the new version.

So in your case I think this is what would happen:

Rule 1:  Looks exactly the same after

Rule 2:  New rule with corrected name is created.  Old rule with typo in name is likely still there.

Rule 3:  Old rule is replaced with same-named new rule

Rule 4:  This rule is no longer in your project, but is probably on the platform.

Stephen Harmon or Clint Dovholuk might be able to confirm or correct this reponse.

Mike's answer is what I'd expect, too. Let's clarify some terminology. An archetype is a definition for a project. Once you instantiate it by choosing it, and bringing it down, it becomes an Artisan project. Think of it like this --> archetype is the class definition; the Artisan project is an instance of the archetype.

sharmon
12-Amethyst
(To:sharmon)

I should clarify - Mike's answer, and my reply, apply to Artisan 6.6. Clint Dovholuk Artisan 6.8 talk hinted at some new configuration flags that will give a developer finer-grained control of how domain objects are created, deleted, and updated. Artisan 6.8 is scheduled to be released later in the year.

ablyth
7-Bedrock
(To:ablyth)

Thanks Stephen Harmon and Mike Wunderlich, this has really helped me understand how the process works.

Top Tags