String uuid1 = serviceImplementation.createNewRule( "workItem1",
"workItem1description",
"testLoadingWorkDefinitionsFromPackageAssetsCategory",
"testLoadingWorkDefinitionsFromPackageAssets",
"wid" );
Asset asset1 = repositoryAssetService.loadRuleAsset( uuid1 );
RuleContentText content1 = new RuleContentText();
content1.content = ""
+ "import org.drools.process.core.datatype.impl.type.StringDataType;\n"
+ "[\n"
+ "[\n"
+ "\"name\" : \"MyTask1\",\n"
+ "\"parameters\" : [\n"
+ "\"StringParam\" : new StringDataType()\n"
+ "],\n"
+ "\"results\" : [\n"
+ "\"StringResult\" : new StringDataType()\n"
+ "],\n"
+ "\"displayName\" : \"My Task1\","
+ "\"icon\" : \"\",\n"
+ "]\n"
+ "]";
asset1.setContent( content1 );
repositoryAssetService.checkinVersion( asset1 );
//Create #2 Work Item definition
String uuid2 = serviceImplementation.createNewRule( "workItem2",
"workItem2description",
"testLoadingWorkDefinitionsFromPackageAssetsCategory",
"testLoadingWorkDefinitionsFromPackageAssets",
"wid" );
Asset asset2 = repositoryAssetService.loadRuleAsset( uuid2 );
RuleContentText content2 = new RuleContentText();
content2.content = ""
+ "import org.drools.process.core.datatype.impl.type.IntegerDataType;\n"
+ "[\n"
+ "[\n"
+ "\"name\" : \"MyTask2\",\n"
+ "\"parameters\" : [\n"
+ "\"IntegerParam\" : new IntegerDataType()\n"
+ "],\n"
+ "\"results\" : [\n"
+ "\"IntegerResult\" : new IntegerDataType()\n"
+ "],\n"
+ "\"displayName\" : \"My Task2\","
+ "\"icon\" : \"\",\n"
+ "]\n"
+ "]";
asset2.setContent( content2 );
repositoryAssetService.checkinVersion( asset2 );
//Create #3 Work Item definition
String uuid3 = serviceImplementation.createNewRule( "workItem3",
"workItem3description",
"testLoadingWorkDefinitionsFromPackageAssetsCategory",
"testLoadingWorkDefinitionsFromPackageAssets",
"wid" );
Asset asset3 = repositoryAssetService.loadRuleAsset( uuid3 );
RuleContentText content3 = new RuleContentText();
content3.content = ""
+ "import org.drools.process.core.datatype.impl.type.ObjectDataType;\n"
+ "[\n"
+ "[\n"
+ "\"name\" : \"MyTask3\",\n"
+ "\"parameters\" : [\n"
+ "\"ObjectParam\" : new ObjectDataType()\n"
+ "],\n"
+ "\"results\" : [\n"
+ "\"ObjectResult\" : new ObjectDataType()\n"
+ "],\n"
+ "\"displayName\" : \"My Task3\","
+ "\"icon\" : \"\",\n"
+ "]\n"
+ "]";
asset3.setContent( content3 );
repositoryAssetService.checkinVersion( asset3 );
try {
AssetWorkDefinitionsLoader loader = new AssetWorkDefinitionsLoader( repositoryAssetService,
packageUUID );