I try to build up a asp.net web application with windows workflow foundation.
I have found some useful sites like:
http://msdn.microsoft.com/en-us/library/bb628441%28v=vs.90%29.aspx
http://msdn.microsoft.com/en-us/library/bb675262%28v=vs.90%29.aspx
The workflow is an Activity
<Activity mc:Ignorable="sap" x:Class="ApproachWithWorkflows.WriteLineActivity" sap:VirtualizedContainerService.HintSize="654,676" mva:VisualBasic.Settings="Assembly references and imported namespaces for internal implementation" xmlns="http://schemas.microsoft.com/netfx/2009/xaml/activities" xmlns:av="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mv="clr-namespace:Microsoft.VisualBasic;assembly=System" xmlns:mva="clr-namespace:Microsoft.VisualBasic.Activities;assembly=System.Activities" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:s1="clr-namespace:System;assembly=System" xmlns:s2="clr-namespace:System;assembly=System.Xml" xmlns:s3="clr-namespace:System;assembly=System.Core" xmlns:sad="clr-namespace:System.Activities.Debugger;assembly=System.Activities" xmlns:sap="http://schemas.microsoft.com/netfx/2009/xaml/activities/presentation" xmlns:scg="clr-namespace:System.Collections.Generic;assembly=System" xmlns:scg1="clr-namespace:System.Collections.Generic;assembly=System.ServiceModel" xmlns:scg2="clr-namespace:System.Collections.Generic;assembly=System.Core" xmlns:scg3="clr-namespace:System.Collections.Generic;assembly=mscorlib" xmlns:sd="clr-namespace:System.Data;assembly=System.Data" xmlns:sl="clr-namespace:System.Linq;assembly=System.Core" xmlns:st="clr-namespace:System.Text;assembly=mscorlib" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Flowchart sad:XamlDebuggerXmlReader.FileName="C:\Documents and Settings\hauke\Desktop\Uni\Masterarbeit SVN SE\Software\Workflowansatz\ApproachWithWorkflows\ApproachWithWorkflows\WriteLineActivity.xaml" sap:VirtualizedContainerService.HintSize="614,636">
<sap:WorkflowViewStateService.ViewState>
<scg3:Dictionary x:TypeArguments="x:String, x:Object">
<x:Boolean x:Key="IsExpanded">False</x:Boolean>
<av:Point x:Key="ShapeLocation">270,2.5</av:Point>
<av:Size x:Key="ShapeSize">60,75</av:Size>
<av:PointCollection x:Key="ConnectorLocation">300,77.5 300,107.5 295.5,107.5 295.5,129</av:PointCollection>
</scg3:Dictionary>
</sap:WorkflowViewStateService.ViewState>
<Flowchart.StartNode>
<x:Reference>__ReferenceID0</x:Reference>
</Flowchart.StartNode>
<FlowStep x:Name="__ReferenceID0">
<sap:WorkflowViewStateService.ViewState>
<scg3:Dictionary x:TypeArguments="x:String, x:Object">
<av:Point x:Key="ShapeLocation">190,129</av:Point>
<av:Size x:Key="ShapeSize">211,59</av:Size>
</scg3:Dictionary>
</sap:WorkflowViewStateService.ViewState>
<WriteLine sap:VirtualizedContainerService.HintSize="211,59" Text="worked.." />
</FlowStep>
I created an asp.net project with a simple button:
<asp:Button Text="Purchase" ID="Label1" runat="server" OnClick="btnClick" />
In the code behind, I try to call the workflow (and initialized the WorkflowRuntime in the global.asax by Application_Start):
WorkflowRuntime workflowRuntime = Application["WorkflowRuntime"] as WorkflowRuntime;
ManualWorkflowSchedulerService manualScheduler =
workflowRuntime.GetService(typeof(ManualWorkflowSchedulerService))
as ManualWorkflowSchedulerService;
WorkflowInstance instance = workflowRuntime.CreateWorkflow(
typeof(ApproachWithWorkflows.WriteLineActivity));
instance.Start();
manualScheduler.RunWorkflow(instance.InstanceId);
When I now execute the application and press the button, I get an error like "The input workflow type must be an Activity.\r\nParameter name: workflowType" at CreateWorkflow.
But the Activity is an Activity! What am I doing wrong?
It looks like you're using WF 3.5 runtime classes to execute a WF 4.0 activity. Take a look at WorkflowInvoker or WorkflowApplication.
Related
I've established new mediawiki environment but I am getting the following error while migrating the sqlite db to the new environment. Also I upgraded to version of mediawiki 1.22 to 1.32. Is there Anybody has any idea about that situation or new steps to establish sqlite from older one.
Turning off Content Handler DB fields for this part of upgrade.
...have ss_active_users field in site_stats table.
An error occurred:
A database query error has occurred. Did you forget to run your application's database schema
updater after upgrading?
Query: UPDATE site_stats SET ss_active_users = '0' WHERE ss_row_id = '1'
Function: DatabaseUpdater::doActiveUsersInit
Error: 8 attempt to write a readonly database
Purging caches...<!DOCTYPE html>
<html><head><title>Dahili hata - MediaWiki</title><style>body { font-family: sans-serif;
margin: 0; padding: 0.5em 2em; }</style></head><body>
<div class="errorbox mw-content-ltr"><p>[Y#YbH#8tt-A18niaaU7SwQAAANQ] /mediawiki/mw-
config/index.php?page=Upgrade Wikimedia\Rdbms\DBQueryError from line 1506 of
/var/www/html/mediawiki/includes/libs/rdbms/database/Database.php: A database query error has
occurred. Did you forget to run your application's database schema updater after upgrading?
<br />
Query: DELETE FROM objectcache<br />
Function: DatabaseUpdater::purgeCache<br />
Error: 8 attempt to write a readonly database<br />
</p><p>Backtrace:</p><p>#0
/var/www/html/mediawiki/includes/libs/rdbms/database/Database.php(1476):
Wikimedia\Rdbms\Database->makeQueryException(string, integer, string, string)<br />
#1 /var/www/html/mediawiki/includes/libs/rdbms/database/Database.php(1236):
Wikimedia\Rdbms\Database->reportQueryError(string, integer, string, string, boolean)<br />
#2 /var/www/html/mediawiki/includes/libs/rdbms/database/Database.php(2964):
Wikimedia\Rdbms\Database->query(string, string)<br />
#3 /var/www/html/mediawiki/includes/installer/DatabaseUpdater.php(1071):
Wikimedia\Rdbms\Database->delete(string, string, string)<br />
#4 /var/www/html/mediawiki/includes/installer/DatabaseInstaller.php(396): DatabaseUpdater-
>purgeCache()<br />
#5 /var/www/html/mediawiki/includes/installer/WebInstallerUpgrade.php(65): DatabaseInstaller-
>doUpgrade()<br />
#6 /var/www/html/mediawiki/includes/installer/WebInstaller.php(272): WebInstallerUpgrade-
>execute()<br />
#7 /var/www/html/mediawiki/mw-config/index.php(79): WebInstaller->execute(array)<br />
#8 /var/www/html/mediawiki/mw-config/index.php(38): wfInstallerMain()<br />
#9 {main}</p></div>
</body></html>
I resolved problem myself, I've shared steps with some guys who want to migrate the mediawiki with sqlite.
sqlite3 my_wiki.sqlite .dump > backup_sqlite.sqlite
The file which has been created by above should be migrate to new sqlite location and than run the that commands for migration old data.
sqlite3 mediawiki.sqlite < backup_sqlite.sqlite
I am facing problem in triggering workflow.
I have applied rule on a Folder
Definition of rule :
i) When Item are created on enter this folder
ii) Name End With .xml
iii)Execute Script
Script is
function startWorkflow()
{
var workflow = actions.create("start-workflow");
workflow.parameters.workflowName = "activiti$Excel_initial_service";
workflow.parameters["bpm:workflowDescription"] = "Excel initial service workflow for : " + document.name;
var futureDate = new Date();
futureDate.setDate(futureDate.getDate() + 1);
workflow.parameters["bpm:workflowDueDate"] = futureDate;
return workflow.execute(document);
}
function main()
{
startWorkflow();
}
main();
and my workflow definition is
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/test">
<process id="Excel_initial_service" name="Excel Initial Service" isExecutable="true">
<startEvent id="startevent1" name="Start"></startEvent>
.
.
.
.
<serviceTask id="servicetask1" name="Service Task" activiti:class="*"> </serviceTask>
.
.
.
.
The problem i am facing is service task is getting triggered multiple times for single file entered in the folder and its not getting stopped.
<?xml version="1.0" encoding="UTF-8"?>
<process id="***" name="Excel Generation Service" isExecutable="true">
<startEvent id="starteventexcel1" name="Start"></startEvent>
<intermediateCatchEvent id="timerintermediatecatcheventexcel1" name="TimerCatchEvent1">
<timerEventDefinition>
<timeDuration>PT10S</timeDuration>
</timerEventDefinition>
</intermediateCatchEvent>
<serviceTask id="servicetaskexcel1" name="Service Task" activiti:class="***"></serviceTask>
<intermediateCatchEvent id="timerintermediatecatcheventexcel2" name="TimerCatchEvent2">
<timerEventDefinition>
<timeDuration>PT10S</timeDuration>
</timerEventDefinition>
</intermediateCatchEvent>
<endEvent id="endeventexcel1" name="End"></endEvent>
<sequenceFlow id="flowexcel1" sourceRef="starteventexcel1" targetRef="timerintermediatecatcheventexcel1"></sequenceFlow>
<sequenceFlow id="flowexcel2" sourceRef="timerintermediatecatcheventexcel1" targetRef="servicetaskexcel1"></sequenceFlow>
<sequenceFlow id="flowexcel3" sourceRef="servicetaskexcel1" targetRef="timerintermediatecatcheventexcel2"></sequenceFlow>
<sequenceFlow id="flowexcel4" sourceRef="timerintermediatecatcheventexcel2" targetRef="endeventexcel1"></sequenceFlow>
</process>
The first intermediateCatchEvent here will execute your service task every 10 sec. Why using it?
this answer may this will help you.
The class to use is the ClockUtil which changes the internal clock of the engine.
That being said, I checked your test and I saw that you are using the
ProcessEngine eng = ProcessEngineConfiguration
.createStandaloneInMemProcessEngineConfiguration()
.buildProcessEngine();
To get the process engine. That will give you a default engine, with the job executor disabled. The job executor is needed for timer execution. Add following line to building the process engine to make it work:
setJobExecutorActivate(true);
You can refer this question https://community.alfresco.com/thread/219801-problem-with-intermediatecatchevent
you will find some code on github as explained in above referred question https://github.com/Activiti/Activiti/blob/master/modules/activiti-engine/src/test/java/org/activiti/engine/test/bpmn/event/timer/IntermediateTimerEventTest.java
I am trying to use pre and post build in my Visual Studio 2015 (TACO) project. As outlined in PreBuildEvent and PostBuildEvent on Visual Studio 2015 Tools for Apache Cordova I have added <Target> elements to my .jsproj file so that it now ends as shown:
<Import Project="_apacheCordovaProjectSourceItems.Targets" Condition="Exists('_apacheCordovaProjectSourceItems.Targets')" />
<Target Name="BeforeBuild">
<Exec Command="if $(ConfigurationName) == Release (echo ** Before Build **)" />
<Exec Command="attrib -R "$(ProjectDir)\platforms\*.*" /S" IgnoreExitCode="true" />
</Target>
<Target Name="AfterBuild">
<Exec Command="if $(ConfigurationName) == Release (echo ** After Build **)" />
<Exec Command="if $(ConfigurationName) == Release (xcopy "$(TargetDir)*.*" "$(SolutionDir)..\..\Binaries\$(PlatformName)\*.*" /Y /S /E /F /I)" />
</Target>
</Project>
My problem is that both the BeforeBuild and AfterBuild events fire at the beginning of the build
1>------ Build started: Project: MyProject, Configuration: Release Android ------
1> ** Before Build **
1> ** After Build **
1> D:\Workspaces\Products\MyProduct\Projects\Main\Sources\Apps\MyProject\bin\Android\Release\android-release-unsigned.apk -> D:\Workspaces\Products\MyProduct\Projects\Binaries\Android\android-release-unsigned.apk
1> D:\Workspaces\Products\MyProduct\Projects\Main\Sources\Apps\MyProject\bin\Android\Release\manifest-merger-release-report.txt -> D:\Workspaces\Products\MyProduct\Projects\Binaries\Android\manifest-merger-release-report.txt
1> 2 File(s) copied
1> Your environment has been set up for using Node.js 0.12.2 (ia32) and npm.
1> ... [Rest of output omitted] ...
Can anybody shed some light on why this is, or how I can get the post build event to run after the build has completed?
After banging my head against a wall for a while I gave up on the Visual Studio AfterBuild event and used a hook for the Cordova after_build one. It fires a bit earlier in the whole build process, but was good enough for my requirements. I'll post the gist of what it entails in case others need to do a similar thing.
Find the config.xml in Solution Explorer, right click on it and select View Code
In the config.xml add a <hook> section as follows
<platform name="android">
<hook type="after_build" src="scripts/afterbuild-copy-to-drop.js" />
</platform>
Here I am hooking into the after_build event for an Android build only.
Now create a scripts folder at the root of the project, ie the same level as the plugins and www folders.
Create a JavaScript file in here with a name that matches the src attribute in the hook definition, ie 'afterbuild-copy-to-drop.js'.
In this script file write the required code. Here is mine
module.exports = function (ctx) {
console.log('Executing custom "' + ctx.hook + '" hook for ' + ctx.opts.platforms);
var path = ctx.requireCordovaModule('path'),
shell = ctx.requireCordovaModule('shelljs');
// make sure we are in a release build
var isRelease = (ctx.cmdLine.indexOf('--configuration Release') >= 0);
var solutionRoot = path.join(ctx.opts.projectRoot, '../..');
var dropRoot = path.join(solutionRoot, '../../Binaries/Release/Apps');
if (isRelease){
if (ctx.opts.platforms == 'android') {
var platformRoot = path.join(ctx.opts.projectRoot, 'platforms/android');
var apkFileLocation = path.join(platformRoot, 'build/outputs/apk/android-release.apk');
dropRoot = path.join(dropRoot, 'Android');
var dropApkFileLocation = path.join(dropRoot, 'my-app.apk');
console.log('------ Making directory \'' + dropRoot + '\'');
shell.mkdir('-p', dropRoot);
console.log('------ Copying \'' + apkFileLocation + '\' to ' + dropApkFileLocation + '\'');
shell.cp('-f', apkFileLocation, dropApkFileLocation);
}
}
console.log('Finished executing "' + ctx.hook + '" hook for ' + ctx.opts.platforms);
};
Further information on hooks can be found at https://cordova.apache.org/docs/en/dev/guide/appdev/hooks/
I am getting below exection when running viewclient. I am running this on Emulator using android-17 api.
viewclient = ViewClient(device, serialno)
File "/Users/dpbuild/Jenkins/workspace/AndroidViewer-FeatureBranch-UIAutomation/siamang/src/dtmilano/android/viewclient.py", line 948, in __init__
self.dump()
File "/Users/dpbuild/Jenkins/workspace/AndroidViewer-FeatureBranch-UIAutomation/siamang/src/dtmilano/android/viewclient.py", line 1478, in dump
self.setViewsFromUiAutomatorDump(received)
File "/Users/dpbuild/Jenkins/workspace/AndroidViewer-FeatureBranch-UIAutomation/siamang/src/dtmilano/android/viewclient.py", line 1251, in setViewsFromUiAutomatorDump
self.__parseTreeFromUiAutomatorDump(received)
File "/Users/dpbuild/Jenkins/workspace/AndroidViewer-FeatureBranch-UIAutomation/siamang/src/dtmilano/android/viewclient.py", line 1405, in _ViewClient__parseTreeFromUiAutomatorDump
self.root = parser.Parse(receivedXml)
File "/Users/dpbuild/Jenkins/workspace/AndroidViewer-FeatureBranch-UIAutomation/siamang/src/dtmilano/android/viewclient.py", line 832, in Parse
parserStatus = parser.Parse(uiautomatorxml, 1) ##UnusedVariable
File "/Tools/android-sdk-macosx/tools/lib/jython.jar/Lib/xml/parsers/expat.py", line 212, in Parse
xml.parsers.expat.ExpatError: XML document structures must start and end within the same entity.
Looking at the uiautomatorxml, by adding a print statement as below:
def Parse(self, uiautomatorxml):
# Create an Expat parser
parser = xml.parsers.expat.ParserCreate()
# Set the Expat event handlers to our methods
parser.StartElementHandler = self.StartElement
parser.EndElementHandler = self.EndElement
parser.CharacterDataHandler = self.CharacterData
# Parse the XML File
**print "DEBUG: " + uiautomatorxml**
parserStatus = parser.Parse(uiautomatorxml, 1) ##UnusedVariable
return self.root
I got,
DEBUG: (XML file starts in a normal fashion, below is tail end of the log that was printed)
<node index="1" text="" class="android.view.View" package="com.android.launcher" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="true" long-clickable="false" password="false" selected="false" bounds="[0,25][800,1232]"><node index="2" text="" class="android.view.View" package="com.android.launcher" content-desc="Home screen 3" checkable="false" checked="false" clickable="true" enabled="true" focusable="false" focus
130515 19:41:07.014:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions] Script terminated due to an exception
Clearly, XML is not fully formed. I was wondering if you had any ideas on why this could be happening and how to resolve this.
I guess its because UIAutomation return contents is too long.Because I got the same message with you,but when I tern to one little view page and run and I fount that ViewClient is work well .. so I guess is something wrong with the sockets message didn't end with the complete oparate...
For me this was linked to performance of the machine where I was running emulator. I was able to resolve this issue by enabling hardware acceleration and having a machine with 1GB graphics card.
Steps for enabling hardware acceleration:
Check "use host gpu" in simulator.
Download and install Intel
HAXM.
I am using JSF1.2 & myfaces implementation.
The correnponding jars used are jsf-api-1.2_04-p02.jar & myfaces-impl-1.2.9.jar.
<h:selectManyCheckbox value="#{restrictionMaintBean.selectedRestrictionTypeList}" layout="pageDirection" tabindex="5" onchange="setChangeFlag(true);">
<f:selectItems value="#{restrictionMaintBean.restrictionTypeList}"/>
</h:selectManyCheckbox>
This code runs fine on tomcat 6.0.20 but tomcat 6.0.35 it gives below exception:
org.apache.myfaces.component.html.ext.HtmlPanelGrid,Id: a18][Class:
javax.faces.component.html.HtmlSelectManyCheckbox,Id:
j_id_jsp_1445681841_62]} is not of type Array or List
at org.apache.myfaces.shared_impl.renderkit.RendererUtils.internalSubmittedOrSelectedValuesAsSet(RendererUtils.java:716)
at org.apache.myfaces.shared_impl.renderkit.RendererUtils.getSelectedValuesAsSet(RendererUtils.java:615)
at org.apache.myfaces.shared_impl.renderkit.html.HtmlCheckboxRendererBase.renderCheckboxList(HtmlCheckboxRendererBase.java:112)
at org.apache.myfaces.shared_impl.renderkit.html.HtmlCheckboxRendererBase.encodeEnd(HtmlCheckboxRendererBase.java:65)