<Process Name="SimpleWF" CanBeInlined="false" Tags="">
  <Designer />
  <Activities>
    <Activity Name="SetParameter" State="SetParameter" IsInitial="True" IsFinal="False" IsForSetState="True" IsAutoSchemeUpdate="True" WasInlined="true" OriginalName="SetParameter" OriginalSchemeCode="ParametersAndExpressions">
      <Implementation>
        <ActionRef Order="1" NameRef="SetParameter">
          <ActionParameter><![CDATA[{"ParameterName":"TestParameter","Value":"5","ForRootProcess":false}]]></ActionParameter>
        </ActionRef>
      </Implementation>
      <Designer X="800" Y="420" Hidden="false" />
    </Activity>
    <Activity Name="AddNumberToParameter" State="AddNumberToParameter" IsInitial="False" IsFinal="False" IsForSetState="True" IsAutoSchemeUpdate="True" WasInlined="true" OriginalName="AddNumberToParameter" OriginalSchemeCode="ParametersAndExpressions">
      <Implementation>
        <ActionRef Order="1" NameRef="AddNumberToParameter">
          <ActionParameter><![CDATA[{"Number":1,"ParameterName":"TestParameter"}]]></ActionParameter>
        </ActionRef>
      </Implementation>
      <Designer X="1080" Y="560" Hidden="false" />
    </Activity>
    <Activity Name="ParameterEqual" State="ParameterEqual" IsInitial="False" IsFinal="True" IsForSetState="True" IsAutoSchemeUpdate="True" WasInlined="true" OriginalName="ParameterEqual" OriginalSchemeCode="ParametersAndExpressions">
      <Designer X="1520" Y="420" Hidden="false" />
    </Activity>
    <Activity Name="CheckParameter" State="CheckParameter" IsInitial="False" IsFinal="False" IsForSetState="True" IsAutoSchemeUpdate="True" WasInlined="true" OriginalName="CheckParameter" OriginalSchemeCode="ParametersAndExpressions">
      <Designer X="1100" Y="420" Hidden="false" />
    </Activity>
  </Activities>
  <Transitions>
    <Transition Name="SetParameter_Activity_1" To="AddNumberToParameter" From="CheckParameter" Classifier="NotSpecified" AllowConcatenationType="And" RestrictConcatenationType="And" ConditionsConcatenationType="And" DisableParentStateControl="false">
      <Triggers>
        <Trigger Type="Auto" />
      </Triggers>
      <Conditions>
        <Condition Type="Expression" ConditionInversion="false">
          <Expression><![CDATA[@TestParameter<10]]></Expression>
        </Condition>
      </Conditions>
      <Designer X="1153" Y="512" Hidden="false" />
    </Transition>
    <Transition Name="UpdateParameter_Activity_1_1" To="CheckParameter" From="AddNumberToParameter" Classifier="NotSpecified" AllowConcatenationType="And" RestrictConcatenationType="And" ConditionsConcatenationType="And" DisableParentStateControl="false">
      <Triggers>
        <Trigger Type="Auto" />
      </Triggers>
      <Conditions>
        <Condition Type="Always" />
      </Conditions>
      <Designer X="1262" Y="526" Hidden="false" />
    </Transition>
    <Transition Name="Activity_1_Activity_1" To="ParameterEqual" From="CheckParameter" Classifier="NotSpecified" AllowConcatenationType="And" RestrictConcatenationType="And" ConditionsConcatenationType="And" DisableParentStateControl="false">
      <Triggers>
        <Trigger Type="Auto" />
      </Triggers>
      <Conditions>
        <Condition Type="Expression" ConditionInversion="false">
          <Expression><![CDATA[@TestParameter>=10]]></Expression>
        </Condition>
      </Conditions>
      <Designer Hidden="false" />
    </Transition>
    <Transition Name="SetParameter_Activity_1_1" To="CheckParameter" From="SetParameter" Classifier="NotSpecified" AllowConcatenationType="And" RestrictConcatenationType="And" ConditionsConcatenationType="And" DisableParentStateControl="false">
      <Triggers>
        <Trigger Type="Auto" />
      </Triggers>
      <Conditions>
        <Condition Type="Always" />
      </Conditions>
      <Designer X="1041" Y="450" Hidden="false" />
    </Transition>
  </Transitions>
  <CodeActions>
    <CodeAction Name="AddNumberToParameter" Type="Action" IsGlobal="False" IsAsync="False" WasInlined="true" OriginalName="AddNumberToParameter" OriginalSchemeCode="ParametersAndExpressions">
      <ActionCode><![CDATA[Dictionary<string, string> parameters = JsonConvert.DeserializeObject<Dictionary<string, string>>(parameter);
var parameterValue = processInstance.GetParameter<string>(parameters["ParameterName"]);
var value = int.Parse(parameterValue);
var number = int.Parse(parameters["Number"]);
processInstance.SetParameter(parameter,(value + number).ToString());]]></ActionCode>
      <Usings><![CDATA[System.Collections.Generic;WF.Sample.Business.Workflow;WF.Sample.Business.DataAccess;System.Threading.Tasks;Microsoft.CSharp.RuntimeBinder;System.Collections;System.Linq;System.Threading;WF.Sample.Business.Model;OptimaJet.Workflow;System.Dynamic;OptimaJet.Workflow.Core.Runtime;OptimaJet.Workflow.Core.Model;System;Microsoft.CSharp;Newtonsoft.Json;]]></Usings>
      <Parameters>
        <Parameter name="ParameterName" type="Text" isRequired="true" />
        <Parameter name="Number" type="Number" isRequired="true">
          <DefaultValue><![CDATA[1]]></DefaultValue>
        </Parameter>
      </Parameters>
    </CodeAction>
  </CodeActions>
</Process>