Skip to content

Commit

Permalink
fixes issue with BPELInstanceData Plugin not finding the proper XML e…
Browse files Browse the repository at this point in the history
…lement to inject instance data handling for Defrost Plan Generation

Signed-off-by: Kálmán Képes <[email protected]>
  • Loading branch information
nyuuyn committed Jul 2, 2019
1 parent c817f2f commit fb075fb
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
Expand All @@ -10,6 +11,7 @@
import java.util.Objects;
import java.util.Set;

import javax.swing.event.ListSelectionEvent;
import javax.wsdl.Definition;
import javax.wsdl.Port;
import javax.wsdl.PortType;
Expand Down Expand Up @@ -259,20 +261,24 @@ public boolean appendToInitSequence(final Node node) {
return true;
}

public BPELPlanContext createContext(final AbstractNodeTemplate nodeTemplate, ActivityType activityType) {
public BPELPlanContext createContext(final AbstractNodeTemplate nodeTemplate, ActivityType... activityType) {
LOG.debug("Trying to create {} plan context for nodeTemplate {}", activityType, nodeTemplate);
for(BPELScope scope : this.templateBuildPlan.getBuildPlan().getTemplateBuildPlans()) {
if(scope.getNodeTemplate() != null && scope.getNodeTemplate().equals(nodeTemplate) && scope.getActivity().getType().equals(activityType)) {
if(scope.getNodeTemplate() != null && scope.getNodeTemplate().equals(nodeTemplate) && Arrays.asList(activityType).contains(scope.getActivity().getType())) {
LOG.debug("Found scope of nodeTemplate");
return new BPELPlanContext((BPELPlan) this.plan, scope, this.propertyMap, this.serviceTemplate, this.serviceInstanceURLVarName,
this.serviceInstanceIDVarName, this.serviceTemplateURLVarName, this.csarFileName);
}
}



return null;
}




/**
* Generates a bpel string variable with the given name + "_" + randomPositiveInt.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1378,8 +1378,14 @@ public boolean handleCreate(final BPELPlanContext context,
final AbstractNodeTemplate sourceNodeTemplate = context.getRelationshipTemplate().getSource();
LOG.debug("Trying to create provisioning plan context for sourceNodeTemplate {} of relationshipTemplate {}", sourceNodeTemplate.toString(), context.getRelationshipTemplate().toString());

injectionPreElement = context.createContext(sourceNodeTemplate,ActivityType.PROVISIONING).getPostPhaseElement();
injectionPostElement = context.createContext(sourceNodeTemplate,ActivityType.PROVISIONING).getPostPhaseElement();
// Right now the knowledge of DEFROST and PROVISIONING activities is to hard of an assumption, if you ask me
BPELPlanContext sourceContext = context.createContext(sourceNodeTemplate,ActivityType.PROVISIONING, ActivityType.DEFROST);
if(sourceContext == null) {
LOG.error("Couldn't create context for sourceNodeTemplate {}" , sourceNodeTemplate.toString());
return false;
}
injectionPreElement = sourceContext.getPostPhaseElement();
injectionPostElement = sourceContext.getPostPhaseElement();
}

if (injectionPostElement == null | injectionPreElement == null | sourceInstanceVarName == null
Expand Down

0 comments on commit fb075fb

Please sign in to comment.