Skip to content

Commit

Permalink
mark for slow operations : TheOpenCloudEngine/uengine-bpm#15
Browse files Browse the repository at this point in the history
  • Loading branch information
jinyoung committed Mar 29, 2017
1 parent 9de4662 commit 7a6089e
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import org.metaworks.Instance;
import org.metaworks.MetaworksContext;
import org.metaworks.annotation.*;
import org.metaworks.dao.TransactionAdvice;
import org.metaworks.dao.TransactionContext;
import org.metaworks.dwr.MetaworksRemoteService;
import org.uengine.essencia.model.Alpha;
Expand Down Expand Up @@ -169,6 +170,8 @@ public void setMetaworksContext(MetaworksContext metaworksContext) {
@Available(when="edit")
public AlphaGameBoard addAlphaInstance(@Payload("instanceId") String instanceId, @Payload("alpha") Alpha alpha) throws Exception {

TransactionContext.getThreadLocalInstance().setMW3FaceOptionEnabled(false);

//TODO: [tunning] find why there is no proper className firstly
if(alpha.getFieldDescriptors()==null){
LanguageElementInstance alphaInstance = alpha.createObjectInstance();
Expand All @@ -178,7 +181,7 @@ public AlphaGameBoard addAlphaInstance(@Payload("instanceId") String instanceId,

alphaInstance.setClassName("codi/" + instance.getProcessDefinition().getId() + "#" + alphaInstance.getClassDefinition().getName());

alphaInstance.fillClassDefinition(alphaInstance.getClassName());
alphaInstance.fillClassDefinition(alphaInstance.getClassName()); ////
alpha = (Alpha) alphaInstance.getLanguageElement();
}

Expand All @@ -190,7 +193,7 @@ public AlphaGameBoard addAlphaInstance(@Payload("instanceId") String instanceId,

ProcessInstance instance = processManagerRemote.getProcessInstance(getInstanceId());

ProcessVariableValue processVariableValue = instance.getMultiple("", alpha.getName());
ProcessVariableValue processVariableValue = instance.getMultiple("", alpha.getName()); //

if(processVariableValue==null){
processVariableValue = new ProcessVariableValue();
Expand All @@ -201,12 +204,12 @@ public AlphaGameBoard addAlphaInstance(@Payload("instanceId") String instanceId,

instance.set("", processVariableValue);

processManagerRemote.applyChanges();
processManagerRemote.applyChanges(); ///


EssenceProcessDefinition essenceProcessDefinition = (EssenceProcessDefinition) instance.getProcessDefinition();
PracticeDefinition practiceDefinition = essenceProcessDefinition.getPracticeDefinition();
GameBoard gameBoard = new GameBoard(instance, true);
GameBoard gameBoard = new GameBoard(instance, true); //

AlphaGameBoard alphaGameBoard = new AlphaGameBoard(getInstanceId(), (Alpha) practiceDefinition.getElementByName(alpha.getName()), gameBoard.getAlphaInstancesMap());
alphaGameBoard.getMetaworksContext().setWhen(MetaworksContext.WHEN_EDIT);
Expand Down
6 changes: 6 additions & 0 deletions essencia-portal/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@
<artifactId>hibernate-validator</artifactId>
<version>4.2.0.Final</version>
</dependency>

<dependency>
<groupId>org.uengine</groupId>
<artifactId>uengine-persistence-couchbase</artifactId>
<version>${uengine.uengine-bpm.version}</version>
</dependency>
<!-- ====== -->
<!-- JSON -->
<!-- ====== -->
Expand Down
16 changes: 14 additions & 2 deletions essencia-portal/src/main/webapp/WEB-INF/customContext.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,24 @@

<import resource="applicationContext.xml"/>

<bean id="storage" class="org.uengine.modeling.resource.LocalFileStorage">
<property name="localBasePath" value="${codebase}"/>
<bean id="storage" class="org.uengine.persistence.couchbase.CouchbaseStorage">
<property name="basePath" value="/"/>
<property name="bucketName" value="default"/>
<property name="serverIp" value="localhost"/>
</bean>

<!--<bean id="storage" class="org.uengine.modeling.resource.LocalFileStorage">-->
<!--<property name="basePath" value="${codebase}"/>-->
<!--</bean>-->


<!--<bean class="org.uengine.modeling.resource.ResourceManager" scope="singleton">-->
<!--<property name="storage" ref="storage"/>-->
<!--</bean>-->

<bean class="org.uengine.modeling.resource.CachedResourceManager" scope="singleton">
<property name="storage" ref="storage"/>
<property name="perTransaction" value="true"/>
</bean>

<util:properties id="config" location="classpath:org/uengine/uengine.properties"/>
Expand Down

0 comments on commit 7a6089e

Please sign in to comment.