about postgreSql autoDeployResources
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-08-2014 04:59 AM
HI,
Currently I'm using Activiti 5.14.
When I use Spring autoDeployResources,it will always create a new deploy even this deploy has saved.
mydb is postgreSql and is on Linux(CentOS),and activiti server is on win7.
I try to get the reason that when the server run this method DeployCmd.deploymentsDiffer(DeploymentEntity deployment, DeploymentEntity saved){},it will get two defferent byte[].
Currently I'm using Activiti 5.14.
When I use Spring autoDeployResources,it will always create a new deploy even this deploy has saved.
mydb is postgreSql and is on Linux(CentOS),and activiti server is on win7.
I try to get the reason that when the server run this method DeployCmd.deploymentsDiffer(DeploymentEntity deployment, DeploymentEntity saved){},it will get two defferent byte[].
Labels:
- Labels:
-
Archive
4 REPLIES 4
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-08-2014 10:26 AM
My understanding is, it will deploy when the system senses if there is any change in the bytes of file that has the deployment resources., so technically if you make a change to one of the bpmn file in the resources directory, it will either increase or decrease the file size, which will be detected by the container and do a new deployment., Would be curious to know what you find.,
<code>
protected boolean deploymentsDiffer(DeploymentEntity deployment, DeploymentEntity saved) {
if(deployment.getResources() == null || saved.getResources() == null) {
return true;
}
Map<String, ResourceEntity> resources = deployment.getResources();
Map<String, ResourceEntity> savedResources = saved.getResources();
for (String resourceName: resources.keySet()) {
ResourceEntity savedResource = savedResources.get(resourceName);
if(savedResource == null) return true;
if(!savedResource.isGenerated()) {
ResourceEntity resource = resources.get(resourceName);
byte[] bytes = resource.getBytes();
byte[] savedBytes = savedResource.getBytes();
if (!Arrays.equals(bytes, savedBytes)) {
return true;
}
}
}
return false;
}
</code>
<code>
protected boolean deploymentsDiffer(DeploymentEntity deployment, DeploymentEntity saved) {
if(deployment.getResources() == null || saved.getResources() == null) {
return true;
}
Map<String, ResourceEntity> resources = deployment.getResources();
Map<String, ResourceEntity> savedResources = saved.getResources();
for (String resourceName: resources.keySet()) {
ResourceEntity savedResource = savedResources.get(resourceName);
if(savedResource == null) return true;
if(!savedResource.isGenerated()) {
ResourceEntity resource = resources.get(resourceName);
byte[] bytes = resource.getBytes();
byte[] savedBytes = savedResource.getBytes();
if (!Arrays.equals(bytes, savedBytes)) {
return true;
}
}
}
return false;
}
</code>
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-08-2014 09:24 PM
First of all thank you for your answer.
I don't change the bpmn file all the time,but it will create new version. when I make a Breakpoint on your code, the bytes and the savedBytes is not equals.
Perhaps it's the coding problem,when mydb and server all on the win7,it will not create new version.
I don't change the bpmn file all the time,but it will create new version. when I make a Breakpoint on your code, the bytes and the savedBytes is not equals.
Perhaps it's the coding problem,when mydb and server all on the win7,it will not create new version.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2014 05:31 AM
Interesting, do you have any path delimiters in the bpmn xml path you deploy to the Engine?
Regards,
Regards,
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2014 03:58 AM
It's OK! postgreSql for Linux has a property “ bytea_output = 'escape' ”