Discussion:
[jboss-user] [jBPM] - How to deploy a BPMN process file by using the JBPM API ?
pichunhan pi
2013-01-22 06:58:37 UTC
Permalink
pichunhan pi [https://community.jboss.org/people/miniservice] created the discussion

"How to deploy a BPMN process file by using the JBPM API ?"

To view the discussion, visit: https://community.jboss.org/message/793402#793402

--------------------------------------------------------------
there's some questions for me .

In my project , i use the spring to manage the KnowledgeBase and the StatefulKnowledgeSession , and the config XML is follow .

<drools:kbase id="kbase">
              <drools:resources>
                <drools:resource type="BPMN2" source="classpath:Evaluation.bpmn" />
                <drools:resource type="BPMN2" source="classpath:WorkTrip.bpmn" />
                <drools:resource type="BPMN2" source="classpath:HR_WorkTrip.bpmn" />
                <drools:resource type="BPMN2" source="classpath:Common_WorkTrip.bpmn" />
                <drools:resource type="BPMN2" source="classpath:Performance.bpmn" />
              </drools:resources>
          </drools:kbase>

          <drools:ksession id="sSession" type="stateful" kbase="kbase">
    <drools:configuration>
      <drools:jpa-persistence>
        <drools:transaction-manager ref="txManager" />
        <drools:entity-manager-factory
          ref="entityManagerFactory" />
      </drools:jpa-persistence>
    </drools:configuration>
            </drools:ksession>



but when i need to add a new BPMN process resource , i need to add a drools:resource config and restart the web server to deploy it into the  KnowledgeBase which is used in my project .
is there a JBPM API for me to deploy it into the KnowledgeBase without using the guvnor ? Like the way in JBPM4.x .

in the JBPM demo , i know that the BPMN resource can be deployed by using this code :

private static KnowledgeBase readKnowledgeBase() throws Exception {
                    KnowledgeBuilder kbuilder = KnowledgeBuilderFactory
                                        .newKnowledgeBuilder();
                    kbuilder.add(ResourceFactory.newClassPathResource("Evaluation.bpmn"),
                                        ResourceType.BPMN2);
                    return kbuilder.newKnowledgeBase();
          }

but when i used the spring , i can't do this to deploy now . because if i use this way , the KnowledgeBase and the StatefulKnowledgeSession are the new instance different with the one in spring IOC .

how can i do ? is there any way to do without using the guvnor web ? just using the JBPM API .
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/793402#793402]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Maciej Swiderski
2013-01-22 18:18:45 UTC
Permalink
Maciej Swiderski [https://community.jboss.org/people/swiderski.maciej] created the discussion

"Re: How to deploy a BPMN process file by using the JBPM API ?"

To view the discussion, visit: https://community.jboss.org/message/793599#793599

--------------------------------------------------------------
you could use KnowledgeAgent together with change set and configure it to monitor a particular directory on file system. It's same mechanism used by jbpm console but it connects to guvnor to monitor for new resources.

HTH
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/793599#793599]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
pichunhan pi
2013-01-24 10:54:32 UTC
Permalink
pichunhan pi [https://community.jboss.org/people/miniservice] created the discussion

"Re: How to deploy a BPMN process file by using the JBPM API ?"

To view the discussion, visit: https://community.jboss.org/message/793998#793998

--------------------------------------------------------------
Could u give me some code for point ? thanks very much !

Cheers
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/793998#793998]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Maciej Swiderski
2013-01-24 18:06:09 UTC
Permalink
Maciej Swiderski [https://community.jboss.org/people/swiderski.maciej] created the discussion

"Re: How to deploy a BPMN process file by using the JBPM API ?"

To view the discussion, visit: https://community.jboss.org/message/794136#794136

--------------------------------------------------------------
http://docs.jboss.org/drools/release/5.2.0.Final/drools-guvnor-docs/html/ch09.html here you can find some details about knowledge agent. And http://drools.46999.n3.nabble.com/Changeset-does-not-monitor-folder-correctly-td3337573.html here you can find a complete test for monitoring directory.

HTH
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/794136#794136]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Loading...