Tuesday, February 24, 2015

Create Redhat JBoss BRMS6 Project in JBoss Developer Studio



 This tutorial explain how to install the BPMS/BRMS plug-ins into JBDS and set up the Drools runtime and configure JBoss BPM Server (EAP-6.1.1).

1. Download and Install Jboss Developer Studio
  1. Go to the Red Hat Customer Portal (https://access.redhat.com/downloads/) and log in.
  2. Click DownloadsProducts Downloads.
  3. In the Product Downloads page under JBoss Development and Management section
  4. Click Red Hat JBoss Developer Studio.
  5. From Software Downloads page, from the Version drop-down menu, select version 7.1.1.
  6. On the Software Downloads page that opens, navigate to the Red Hat JBoss Developer Studio 7.1.1 Stand Alone Universal Binary row and click Download.
  7. Start the installer
$ cd /path/to/.jar
$ java -jar jboss-devstudio-version-installer-standalone.jar
  1. Follow the on-screen instructions to complete the installation process.
2. Installing the BRMS and BPMS Plug-ins
  1. Start JBoss Developer Studio.
  2. Select HelpInstall New Software.
  3. Click Add to enter the Add Repository menu.
  4. Give the software site a name next to Name field and add the following url in the Location field: https://devstudio.jboss.com/updates/7.0/integration-stack/
    (As an alternative, one can download the offline archive and install from an archive.)
  5. Click OK
  6. Select the JBoss Business Process and Rule Development feature from the available options and click Next and then Next again.
  7. Read the license and accept it by selecting the appropriate radio button, and click Finish.
  8. After installation of the plug-ins has completed, restart JBoss Developer Studio.
3. Setting the Drools runtime
Download the generic BPM Suite deployable zip from the Red Hat Customer Portal. Unzip this bundle and find another zip file, jboss-bpms-engine.zip. Unzip this bundle in a convenient location. Set up the Drools runtime in JBDS:
  1. From the JBDS menu, select Window and click Preferences.
  2. Select Drools > Installed Drools Runtimes.
  3. Click Add to reveal the Drools Runtime dialog.
  4. Enter the following in the dialog:
Name: Drools 6 Runtime
Path: Browse to the folder where one unzipped the BPMS engine files.
  1. Click OK.
  2. Click the checkbox next to the runtime to make it the default and click OK.
4. Configuring the JBoss BPMS Server
  1. Open the jBPM view by selecting WindowOpen PerspectiveOther and select jBPM and click OK.
  2. Add the server view by selecting WindowShow ViewOther... and select ServerServers.
  3. Open the server menu by right clicking the Servers panel and select NewServer.
  4. Define the server by selecting JBoss Enterprise MiddlewareJBoss Enterprise Application Platform 6.1+ and clicking Next.
  5. Set the home directory by clicking the Browse button. Navigate to and select the installation directory for JBoss EAP 6.1.1 which has JBoss BPM Suite installed.
  6. Provide a name for the server in the Name field, make sure that the configuration file is set, and click Finish.

How to Create Custom Role(Group) in Red Hat JBoss BPM 6 Business Central


In this tutorial, I am going to show you how to create a new user with human task management roles only, This user can not perform any other task except to manage the human task assigned to him or he belongs to the group based tasks.
This way you can create your own custom roles and restrict the access to those resources in business central.
  • Navigate to  /jboss-eap-6.1/standalone/deployments/business-central.war/WEB-INF/classes
  • Open workbench-policy.properties file in xml editor
  • Under  # Groups of features section add the following line of code and save the  file
           group.wb_for_taskworker=wb_task_management



  • Under # Granted roles per feature section add the following code and save it
          roles.wb_for_taskworker=taskworker

 
  • Navigate to  /jboss-eap-6.1/standalone/deployments/business-central.war/WEB-INF/classes folder
  • Open the web.xml in xml editor
  • Go to   <!-- security settings --> section
  • Add the following yellow highlighted code in 
  <security-constraint>
    <web-resource-collection>
      <web-resource-name>console</web-resource-name>
      <url-pattern>/org.kie.workbench.KIEWebapp/*</url-pattern>
      <url-pattern>*.erraiBus</url-pattern>
    </web-resource-collection>
    <auth-constraint>
      <role-name>admin</role-name>
       .....
      <role-name>taskworker</role-name>
    </auth-constraint>
  </security-constraint>

    <security-constraint>
        <web-resource-collection>
          <web-resource-name>formModeler</web-resource-name>
          <url-pattern>/formModeler/*</url-pattern>
        </web-resource-collection>
        <auth-constraint>
          <role-name>admin</role-name>
            ......
         <role-name>taskworker</role-name>
        </auth-constraint>
    </security-constraint>
            
  • Add the following code in the security-role section
  <security-role>
    <description>Task Worker - normal user of the system to take actions on business tasks. Works primarily with the task lists.
    </description>
    <role-name>taskworker</role-name>
  </security-role>

  • Save the file.
  • Navigate to  /jboss-eap-6.1/bin folder
  • Run the ./add-user.sh and add a new user and assigned the newly created role to the user.


  • Restart the EAP server and log in to BPM Business  Central using the newly created role userid /password.

Friday, February 13, 2015

Create New Project In Red Hat JBoss BPM Business Central


In this tutorial, you can able to create a project using Red Hat JBoss BPMS Workbench (Business Central).


Organization Unit
This is the top level. An installation may have one or more organization units.
Repository
Each Organizational unit can have one or more repositories. A repository is a physical git repository, stored on disk.
Project
Each Repository can have one or more projects. A project forms the deployable unit and complies down to a jar. A project can depend on one or more other projects.
1. Log In
  1. If necessary, restart your jboss server and create new application user.
  2. Open a web browser, and go to http://localhost:8080/business-central. A log-in screen appears.
  3. Log in with the username and password. The JBoss BPM Suite 6 home page appears.
Figure 1. JBoss BPM Suite 6 home page


2. Add a New Organizational Unit
In JBoss BPM Suite 6, assets are organized into organizational units, repositories, and projects. Therefore, you first need to create an organizational unit.
  1. From the menu, select Authoring → Administration.
  2. Select Organizational Units → Manage Organizational Units.
  3. On the Organizational Unit Manager screen, click Add.
  4. On the screen that appears, enter the following:
    • Name - myOrgUnit
  5. Click Ok.


    Figure 2. Add New Organizational Unit screen
3. Create a New Repository
Next, you need to create or clone a repository. JBoss BPM Suite 6 uses Git to provide the repository structure, so you can either clone an existing Git repository or create a new one. For this lab, create a new repository.
  1. Click the Repositories link (next to Organizational Units on the administration page) and select New repository.
  2. On the screen that appears, enter or select the following:
    • Repository Name - demoRepo
    • Organizational Unit - myOrgUnit 
       
  3. Click Create.
  4. Click Ok.


4. Create a New Project
Now you can create a project, which is the main organizational and deployment unit for your business rules assets. A project is modeled like a Maven project. When you deploy a project, it deploys as a Maven artifact (.jar and .pom) in a Maven repo (the default internal repo in JBoss BPM Suite 6), ready to be incorporated and consumed by applications.
  1. From the main menu, select Authoring → Project Authoring
  2. The Project Explorer screen appears, which shows the organizational structure. Make sure that the myOrgUnit organizational unit and the demoRepo repository are selected.
  1. On the menu, select New Item → Project.
  2. In the Resource Name field, enter demoproject.
  3. Click Ok
     
  1. In the Group ID field, enter org.myorgunit.myproject
    This group id and artifact id should conform maven standards, this will be used in deployment unit id.
  2. Click Finish